Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Inline

Manav Rathic90c740d8313
diff --git a/web/apps/accounts/src/pages/passkeys/index.tsx b/web/apps/accounts/src/pages/passkeys/index.tsx
index b1f54403fc..af4076e14a 100644
--- a/web/apps/accounts/src/pages/passkeys/index.tsx
+++ b/web/apps/accounts/src/pages/passkeys/index.tsx
@@ -3,9 +3,8 @@ import { MenuItemDivider, MenuItemGroup } from "@/base/components/Menu";
import { Titlebar } from "@/base/components/Titlebar";
import log from "@/base/log";
import { ensure } from "@/utils/ensure";
-import { CenteredFlex } from "@ente/shared/components/Container";
+import { CenteredFlex, FlexWrapper } from "@ente/shared/components/Container";
import FormPaper from "@ente/shared/components/Form/FormPaper";
-import InfoItem from "@ente/shared/components/Info/InfoItem";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import SingleInputForm from "@ente/shared/components/SingleInputForm";
import { formatDateTimeFull } from "@ente/shared/time/format";
@@ -17,6 +16,7 @@ import KeyIcon from "@mui/icons-material/Key";
import {
Box,
Dialog,
+ IconButton,
Stack,
Typography,
styled,
@@ -303,15 +303,9 @@ const ManagePasskeyDrawer: React.FC<ManagePasskeyDrawerProps> = ({
title={t("manage_passkey")}
onRootClose={onClose}
/>
- <InfoItem
- icon={<CalendarTodayIcon />}
- title={t("CREATED_AT")}
- caption={formatDateTimeFull(
- passkey.createdAt / 1000,
- )}
- loading={false}
- hideEditOption
- />
+ <CreatedAtEntry>
+ {formatDateTimeFull(passkey.createdAt / 1000)}
+ </CreatedAtEntry>
<MenuItemGroup>
<EnteMenuItem
onClick={() => {
@@ -348,6 +342,28 @@ const ManagePasskeyDrawer: React.FC<ManagePasskeyDrawerProps> = ({
);
};
+const CreatedAtEntry: React.FC<React.PropsWithChildren> = ({ children }) => {
+ return (
+ <FlexWrapper justifyContent="space-between">
+ <Box display={"flex"} alignItems="flex-start" gap={0.5} pr={1}>
+ <IconButton
+ color="secondary"
+ sx={{ "&&": { cursor: "default", m: 0.5 } }}
+ disableRipple
+ >
+ <CalendarTodayIcon />
+ </IconButton>
+ <Box py={0.5}>
+ <Typography>{t("CREATED_AT")}</Typography>
+ <Typography variant="small" color="text.muted">
+ {children}
+ </Typography>
+ </Box>
+ </Box>
+ </FlexWrapper>
+ );
+};
+
interface RenamePasskeyDialogProps {
/** If `true`, then the dialog is shown. */
open: boolean;
diff --git a/web/packages/shared/components/Info/InfoItem.tsx b/web/packages/shared/components/Info/InfoItem.tsx
deleted file mode 100644
index 3cc9f5d35c..0000000000
--- a/web/packages/shared/components/Info/InfoItem.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import { FlexWrapper } from "@ente/shared/components/Container";
-import Edit from "@mui/icons-material/Edit";
-import { Box, IconButton, Typography } from "@mui/material";
-import { SmallLoadingSpinner } from "../styledComponents/SmallLoadingSpinner";
-
-interface Iprops {
- icon: JSX.Element;
- title?: string;
- caption?: string | JSX.Element;
- openEditor?: any;
- loading?: boolean;
- hideEditOption?: any;
- customEndButton?: any;
- children?: any;
-}
-
-export default function InfoItem({
- icon,
- title,
- caption,
- openEditor,
- loading,
- hideEditOption,
- customEndButton,
- children,
-}: Iprops): JSX.Element {
- return (
- <FlexWrapper justifyContent="space-between">
- <Box display={"flex"} alignItems="flex-start" gap={0.5} pr={1}>
- <IconButton
- color="secondary"
- sx={{ "&&": { cursor: "default", m: 0.5 } }}
- disableRipple
- >
- {icon}
- </IconButton>
- <Box py={0.5}>
- {children ? (
- children
- ) : (
- <>
- <Typography sx={{ wordBreak: "break-all" }}>
- {title}
- </Typography>
- <Typography variant="small" color="text.muted">
- {caption}
- </Typography>
- </>
- )}
- </Box>
- </Box>
- {customEndButton
- ? customEndButton
- : !hideEditOption && (
- <IconButton onClick={openEditor} color="secondary">
- {!loading ? <Edit /> : <SmallLoadingSpinner />}
- </IconButton>
- )}
- </FlexWrapper>
- );
-}
diff --git a/web/packages/shared/components/styledComponents/SmallLoadingSpinner.tsx b/web/packages/shared/components/styledComponents/SmallLoadingSpinner.tsx
deleted file mode 100644
index 996a80c6a5..0000000000
--- a/web/packages/shared/components/styledComponents/SmallLoadingSpinner.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator";
-
-export const SmallLoadingSpinner = () => (
- <ActivityIndicator
- style={{
- width: "20px",
- height: "20px",
- }}
- />
-);