|
|
|
|
@ -8,10 +8,11 @@ import Icon from "../Icon";
|
|
|
|
|
|
|
|
|
|
interface Props extends DialogProps {
|
|
|
|
|
memoId?: number;
|
|
|
|
|
cacheKey?: string;
|
|
|
|
|
relationList?: MemoRelation[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const MemoEditorDialog: React.FC<Props> = ({ memoId, relationList, destroy }: Props) => {
|
|
|
|
|
const MemoEditorDialog: React.FC<Props> = ({ memoId, cacheKey, relationList, destroy }: Props) => {
|
|
|
|
|
const globalStore = useGlobalStore();
|
|
|
|
|
const tagStore = useTagStore();
|
|
|
|
|
const { systemStatus } = globalStore.state;
|
|
|
|
|
@ -26,10 +27,10 @@ const MemoEditorDialog: React.FC<Props> = ({ memoId, relationList, destroy }: Pr
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<div className="dialog-header-container">
|
|
|
|
|
<div className="w-full flex flex-row justify-between items-center mb-2">
|
|
|
|
|
<div className="flex flex-row justify-start items-center">
|
|
|
|
|
<img className="w-5 h-auto rounded-full shadow" src={systemStatus.customizedProfile.logoUrl} alt="" />
|
|
|
|
|
<p className="ml-1 text-black opacity-80 dark:text-gray-200">{systemStatus.customizedProfile.name}</p>
|
|
|
|
|
<img className="w-6 h-auto rounded-full shadow" src={systemStatus.customizedProfile.logoUrl} alt="" />
|
|
|
|
|
<p className="ml-1 text-lg opacity-80 dark:text-gray-300">{systemStatus.customizedProfile.name}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<IconButton size="sm" onClick={handleCloseBtnClick}>
|
|
|
|
|
<Icon.X className="w-5 h-auto" />
|
|
|
|
|
@ -38,7 +39,7 @@ const MemoEditorDialog: React.FC<Props> = ({ memoId, relationList, destroy }: Pr
|
|
|
|
|
<div className="flex flex-col justify-start items-start max-w-full w-[36rem]">
|
|
|
|
|
<MemoEditorV1
|
|
|
|
|
className="border-none !p-0 -mb-2"
|
|
|
|
|
cacheKey={`memo-editor-${memoId}`}
|
|
|
|
|
cacheKey={`memo-editor-${cacheKey || memoId}`}
|
|
|
|
|
memoId={memoId}
|
|
|
|
|
relationList={relationList}
|
|
|
|
|
onConfirm={handleCloseBtnClick}
|
|
|
|
|
@ -49,7 +50,7 @@ const MemoEditorDialog: React.FC<Props> = ({ memoId, relationList, destroy }: Pr
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default function showMemoEditorDialog(props: Pick<Props, "memoId" | "relationList"> = {}): void {
|
|
|
|
|
export default function showMemoEditorDialog(props: Pick<Props, "memoId" | "cacheKey" | "relationList"> = {}): void {
|
|
|
|
|
generateDialog(
|
|
|
|
|
{
|
|
|
|
|
className: "memo-editor-dialog",
|
|
|
|
|
|