mirror of https://github.com/usememos/memos
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
3 years ago
|
import { useEffect } from "react";
|
||
|
import { memoService } from "../services";
|
||
|
import { showDialog } from "./Dialog";
|
||
|
import MyAccountSection from "./MyAccountSection";
|
||
|
import PreferencesSection from "./PreferencesSection";
|
||
|
import "../less/setting-dialog.less";
|
||
|
|
||
|
interface Props extends DialogProps {}
|
||
|
|
||
|
const SettingDialog: React.FC<Props> = (props: Props) => {
|
||
|
const { destroy } = props;
|
||
|
|
||
|
useEffect(() => {
|
||
|
memoService.fetchAllMemos();
|
||
|
}, []);
|
||
|
|
||
|
return (
|
||
|
<>
|
||
|
<div className="dialog-header-container">
|
||
|
<p className="title-text">
|
||
|
<span className="icon-text">👤</span>
|
||
|
Setting
|
||
|
</p>
|
||
|
<button className="btn close-btn" onClick={destroy}>
|
||
|
<img className="icon-img" src="/icons/close.svg" />
|
||
|
</button>
|
||
|
</div>
|
||
|
<div className="dialog-content-container">
|
||
|
<MyAccountSection />
|
||
|
<PreferencesSection />
|
||
|
</div>
|
||
|
</>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default function showSettingDialog(): void {
|
||
|
showDialog(
|
||
|
{
|
||
|
className: "setting-dialog",
|
||
|
useAppContext: true,
|
||
|
},
|
||
|
SettingDialog,
|
||
|
{}
|
||
|
);
|
||
|
}
|