|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
import { Button } from "@mui/joy";
|
|
|
|
|
import { Button, Dropdown, Menu, MenuButton, MenuItem } from "@mui/joy";
|
|
|
|
|
import { memoServiceClient } from "@/grpcweb";
|
|
|
|
|
import { downloadFileFromUrl } from "@/helpers/utils";
|
|
|
|
|
import useCurrentUser from "@/hooks/useCurrentUser";
|
|
|
|
|
import { useTranslate } from "@/utils/i18n";
|
|
|
|
|
import showChangePasswordDialog from "../ChangePasswordDialog";
|
|
|
|
|
import Icon from "../Icon";
|
|
|
|
|
import showUpdateAccountDialog from "../UpdateAccountDialog";
|
|
|
|
|
import UserAvatar from "../UserAvatar";
|
|
|
|
|
import AccessTokenSection from "./AccessTokenSection";
|
|
|
|
@ -33,15 +34,27 @@ const MyAccountSection = () => {
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="w-full flex flex-row justify-start items-center mt-2 space-x-2">
|
|
|
|
|
<Button variant="outlined" onClick={showUpdateAccountDialog}>
|
|
|
|
|
<Button variant="outlined" color="neutral" size="sm" onClick={showUpdateAccountDialog}>
|
|
|
|
|
<Icon.PenLine className="w-4 h-4 mx-auto mr-1" />
|
|
|
|
|
{t("common.edit")}
|
|
|
|
|
</Button>
|
|
|
|
|
<Button variant="outlined" onClick={showChangePasswordDialog}>
|
|
|
|
|
{t("setting.account-section.change-password")}
|
|
|
|
|
</Button>
|
|
|
|
|
<Button variant="outlined" onClick={() => downloadExportedMemos(user)}>
|
|
|
|
|
{t("setting.account-section.export-memos")}
|
|
|
|
|
</Button>
|
|
|
|
|
<Dropdown>
|
|
|
|
|
<MenuButton slots={{ root: "div" }}>
|
|
|
|
|
<Button variant="outlined" color="neutral" size="sm">
|
|
|
|
|
<Icon.MoreVertical className="w-4 h-4 mx-auto" />
|
|
|
|
|
</Button>
|
|
|
|
|
</MenuButton>
|
|
|
|
|
<Menu className="text-sm" size="sm" placement="bottom">
|
|
|
|
|
<MenuItem onClick={showChangePasswordDialog}>
|
|
|
|
|
<Icon.ArchiveRestore className="w-4 h-auto" />
|
|
|
|
|
{t("setting.account-section.change-password")}
|
|
|
|
|
</MenuItem>
|
|
|
|
|
<MenuItem onClick={() => downloadExportedMemos(user)}>
|
|
|
|
|
<Icon.Trash className="w-4 h-auto" />
|
|
|
|
|
{t("setting.account-section.export-memos")}
|
|
|
|
|
</MenuItem>
|
|
|
|
|
</Menu>
|
|
|
|
|
</Dropdown>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<AccessTokenSection />
|
|
|
|
|