Document emoji picker (#4338)

Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
Apoorv Mishra
2023-09-03 18:41:14 +05:30
committed by GitHub
parent 0054b7152e
commit 1c7bb65c7a
57 changed files with 1367 additions and 510 deletions

View File

@@ -4,7 +4,6 @@ import { action, autorun, computed, observable, set } from "mobx";
import { ExportContentType } from "@shared/types";
import type { NavigationNode } from "@shared/types";
import Storage from "@shared/utils/Storage";
import parseTitle from "@shared/utils/parseTitle";
import { isRTL } from "@shared/utils/rtl";
import DocumentsStore from "~/stores/DocumentsStore";
import User from "~/models/User";
@@ -68,6 +67,13 @@ export default class Document extends ParanoidModel {
@observable
title: string;
/**
* An emoji to use as the document icon.
*/
@Field
@observable
emoji: string | undefined | null;
/**
* Whether this is a template.
*/
@@ -127,12 +133,6 @@ export default class Document extends ParanoidModel {
revision: number;
@computed
get emoji() {
const { emoji } = parseTitle(this.title);
return emoji;
}
/**
* Returns the direction of the document text, either "rtl" or "ltr"
*/