mirror of
https://github.com/ente-io/ente.git
synced 2025-08-07 07:03:35 +00:00
Systematize
This commit is contained in:
parent
1cf2b24049
commit
296dc21e88
@ -1,10 +1,10 @@
|
||||
import { EnteDrawer } from "@/base/components/EnteDrawer";
|
||||
import { MenuItemDivider, MenuItemGroup } from "@/base/components/Menu";
|
||||
import { Titlebar } from "@/base/components/Titlebar";
|
||||
import { useIsMobileWidth } from "@/base/hooks";
|
||||
import log from "@/base/log";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { CenteredFlex } from "@ente/shared/components/Container";
|
||||
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
|
||||
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||
import InfoItem from "@ente/shared/components/Info/InfoItem";
|
||||
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
|
||||
@ -15,7 +15,7 @@ import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
||||
import DeleteIcon from "@mui/icons-material/Delete";
|
||||
import EditIcon from "@mui/icons-material/Edit";
|
||||
import KeyIcon from "@mui/icons-material/Key";
|
||||
import { Box, Stack, Typography, styled, useMediaQuery } from "@mui/material";
|
||||
import { Box, Dialog, Stack, Typography, styled } from "@mui/material";
|
||||
import { t } from "i18next";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import {
|
||||
@ -361,7 +361,7 @@ const RenamePasskeyDialog: React.FC<RenamePasskeyDialogProps> = ({
|
||||
passkey,
|
||||
onRenamePasskey,
|
||||
}) => {
|
||||
const fullScreen = useMediaQuery("(max-width: 428px)");
|
||||
const fullScreen = useIsMobileWidth();
|
||||
|
||||
const handleSubmit = async (inputValue: string) => {
|
||||
try {
|
||||
@ -373,20 +373,27 @@ const RenamePasskeyDialog: React.FC<RenamePasskeyDialogProps> = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<DialogBoxV2
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
fullScreen={fullScreen}
|
||||
fullWidth
|
||||
{...{ open, onClose, fullScreen }}
|
||||
attributes={{ title: t("rename_passkey") }}
|
||||
PaperProps={{ sx: { maxWidth: "360px" } }}
|
||||
>
|
||||
<SingleInputForm
|
||||
initialValue={passkey.friendlyName}
|
||||
callback={handleSubmit}
|
||||
placeholder={t("enter_passkey_name")}
|
||||
buttonText={t("RENAME")}
|
||||
fieldType="text"
|
||||
secondaryButtonAction={onClose}
|
||||
submitButtonProps={{ sx: { mt: 1, mb: 2 } }}
|
||||
/>
|
||||
</DialogBoxV2>
|
||||
<Stack gap={3} p={3}>
|
||||
<Typography variant="large" fontWeight={"bold"}>
|
||||
{t("rename_passkey")}
|
||||
</Typography>
|
||||
<SingleInputForm
|
||||
initialValue={passkey.friendlyName}
|
||||
callback={handleSubmit}
|
||||
placeholder={t("enter_passkey_name")}
|
||||
buttonText={t("RENAME")}
|
||||
fieldType="text"
|
||||
secondaryButtonAction={onClose}
|
||||
submitButtonProps={{ sx: { mt: 1, mb: 0 } }}
|
||||
/>
|
||||
</Stack>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user