mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
3681d1c9b2
* fix: Fetch emoji name if neccessary * Avoid re-render * fix: Minor layout issues in emoji dialog picker * Add upload button to empty search results
57 lines
980 B
TypeScript
57 lines
980 B
TypeScript
import { computed, observable } from "mobx";
|
|
import User from "./User";
|
|
import Model from "./base/Model";
|
|
import Field from "./decorators/Field";
|
|
import Relation from "./decorators/Relation";
|
|
|
|
class Emoji extends Model {
|
|
static modelName = "Emoji";
|
|
|
|
/** The name of the emoji */
|
|
@Field
|
|
@observable
|
|
private _name: string;
|
|
|
|
/** The URL of the emoji image */
|
|
@Field
|
|
@observable
|
|
url: string;
|
|
|
|
/** The ID of the related attachment */
|
|
@Field
|
|
@observable
|
|
attachmentId: string;
|
|
|
|
/** The user who created this emoji */
|
|
@Relation(() => User)
|
|
@observable
|
|
createdBy?: User;
|
|
|
|
/** The ID of the user who created this emoji */
|
|
@Field
|
|
@observable
|
|
createdById: string;
|
|
|
|
get searchContent(): string {
|
|
return this.name;
|
|
}
|
|
|
|
@computed
|
|
get shortName(): string {
|
|
return `:${this.name}:`;
|
|
}
|
|
|
|
/**
|
|
* emoji name
|
|
*/
|
|
get name() {
|
|
return this._name;
|
|
}
|
|
|
|
set name(value: string) {
|
|
this._name = value;
|
|
}
|
|
}
|
|
|
|
export default Emoji;
|