feat: memo editor dialog (#1772)

* feat: memo editor dialog

* chore: update mark

* chore: update
This commit is contained in:
boojack
2023-05-30 20:23:26 +08:00
committed by GitHub
parent 25ce36e495
commit dd8c10743d
14 changed files with 215 additions and 404 deletions

View File

@ -0,0 +1,39 @@
import { generateDialog } from "../Dialog";
import Icon from "../Icon";
import MemoEditor from ".";
interface Props extends DialogProps {
memoId?: MemoId;
relationList?: MemoRelation[];
}
const MemoEditorDialog: React.FC<Props> = ({ memoId, relationList, destroy }: Props) => {
const handleCloseBtnClick = () => {
destroy();
};
return (
<>
<div className="dialog-header-container">
<p className="title-text flex items-center">MEMOS</p>
<button className="btn close-btn" onClick={handleCloseBtnClick}>
<Icon.X />
</button>
</div>
<div className="flex flex-col justify-start items-start max-w-full w-[36rem]">
<MemoEditor memoId={memoId} relationList={relationList} onConfirm={handleCloseBtnClick} />
</div>
</>
);
};
export default function showMemoEditorDialog(props: Pick<Props, "memoId" | "relationList"> = {}): void {
generateDialog(
{
className: "memo-editor-dialog",
dialogName: "memo-editor-dialog",
},
MemoEditorDialog,
props
);
}