Skip to content

armgit / ente

Public Imported from GitHub
0

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

update(locker):collections-page

Aswin Asok3ee59d7dd6d1
diff --git a/web/apps/locker/src/components/ItemList.tsx b/web/apps/locker/src/components/ItemList.tsx
index 6a384d79bb..3fcbf4963d 100644
--- a/web/apps/locker/src/components/ItemList.tsx
+++ b/web/apps/locker/src/components/ItemList.tsx
@@ -17,7 +17,13 @@ import {
sortLockerCollections,
visibleLockerCollections,
} from "@/types";
-import AddOutlinedIcon from "@mui/icons-material/AddOutlined";
+import {
+ Link01Icon,
+ PlusSignIcon,
+ StarIcon,
+ Wallet05Icon,
+} from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded";
import CheckCircleRoundedIcon from "@mui/icons-material/CheckCircleRounded";
import ChevronLeftRoundedIcon from "@mui/icons-material/ChevronLeftRounded";
@@ -28,10 +34,8 @@ import DeleteSweepOutlinedIcon from "@mui/icons-material/DeleteSweepOutlined";
import EditOutlinedIcon from "@mui/icons-material/EditOutlined";
import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";
import FilterListRoundedIcon from "@mui/icons-material/FilterListRounded";
-import FolderOutlinedIcon from "@mui/icons-material/FolderOutlined";
import LogoutOutlinedIcon from "@mui/icons-material/LogoutOutlined";
import ShareOutlinedIcon from "@mui/icons-material/ShareOutlined";
-import StarIcon from "@mui/icons-material/Star";
import {
Box,
Button,
@@ -64,6 +68,9 @@ import {
lockerColorSx,
lockerContentMaxWidth,
lockerTextBodySx,
+ lockerTextDisplay2Sx,
+ lockerTextLargeSx,
+ lockerTextMiniSx,
} from "./locker-tokens";
const uniqueCollectionsByID = (collections: LockerCollection[]) => {
@@ -959,23 +966,31 @@ export const ItemList: React.FC<ItemListProps> = ({
true,
);
}}
- sx={{
- width: 40,
- height: 40,
- color: "#FFFFFF",
- background: "#0E6BFF",
- border: "1px solid rgba(160, 199, 255, 0.18)",
- boxShadow:
- "0 10px 24px rgba(0, 66, 173, 0.20)",
+ sx={(theme) => ({
+ width: 36,
+ height: 36,
+ borderRadius: "12px",
+ padding: 0,
+ ...lockerColorSx(theme, {
+ backgroundColor:
+ "fillLight",
+ color: "iconColor",
+ }),
"&:hover": {
- background: "#1A7AFF",
- boxShadow:
- "0 12px 28px rgba(0, 66, 173, 0.24)",
+ ...lockerColorSx(
+ theme,
+ {
+ backgroundColor:
+ "fillDark",
+ },
+ ),
},
- }}
+ })}
>
- <AddOutlinedIcon
- sx={{ fontSize: 24 }}
+ <HugeiconsIcon
+ icon={PlusSignIcon}
+ size={18}
+ strokeWidth={1.5}
/>
</IconButton>
</Tooltip>
@@ -1003,8 +1018,10 @@ export const ItemList: React.FC<ItemListProps> = ({
</Box>
) : (
<EmptyState
+ image={{
+ src: "/images/empty_state.png",
+ }}
title={t("noCollections")}
- subtitle={t("createCollection")}
/>
)}
</>
@@ -1366,46 +1383,83 @@ export const ItemList: React.FC<ItemListProps> = ({
const SectionHeader: React.FC<{
title: string;
- countLabel: string;
+ countLabel?: string;
action?: React.ReactNode;
onBack?: () => void;
-}> = ({ title, countLabel, action, onBack }) => (
- <Stack
- direction="row"
- sx={{
- alignItems: "center",
- justifyContent: "space-between",
- gap: 2,
- maxWidth: lockerContentMaxWidth,
- mx: "auto",
- mt: 1,
- mb: 2.25,
- }}
- >
+}> = ({ title, countLabel, action, onBack }) =>
+ onBack ? (
+ <Stack
+ sx={{
+ gap: 2,
+ maxWidth: lockerContentMaxWidth,
+ mx: "auto",
+ mt: 1,
+ mb: 2.25,
+ }}
+ >
+ <IconButton
+ aria-label="Back"
+ onClick={onBack}
+ sx={(theme) => ({
+ alignSelf: "flex-start",
+ width: 36,
+ height: 36,
+ flexShrink: 0,
+ borderRadius: "12px",
+ padding: 0,
+ ...lockerColorSx(theme, {
+ color: "iconColor",
+ backgroundColor: "fillLight",
+ }),
+ "&:hover": {
+ ...lockerColorSx(theme, {
+ backgroundColor: "fillDark",
+ }),
+ },
+ })}
+ >
+ <ArrowBackRoundedIcon sx={{ fontSize: 18 }} />
+ </IconButton>
+ <Stack
+ direction="row"
+ sx={{
+ alignItems: "center",
+ justifyContent: "space-between",
+ gap: 2,
+ }}
+ >
+ <Box sx={{ minWidth: 0 }}>
+ <Typography sx={{ ...lockerTextDisplay2Sx, minWidth: 0 }}>
+ {title}
+ </Typography>
+ {countLabel && (
+ <Typography
+ sx={(theme) => ({
+ ...lockerTextMiniSx,
+ mt: 1,
+ ...lockerColorSx(theme, { color: "textLight" }),
+ })}
+ >
+ {countLabel}
+ </Typography>
+ )}
+ </Box>
+ {action}
+ </Stack>
+ </Stack>
+ ) : (
<Stack
direction="row"
- sx={{ minWidth: 0, gap: 1.5, alignItems: "center" }}
+ sx={{
+ alignItems: "center",
+ justifyContent: "space-between",
+ gap: 2,
+ maxWidth: lockerContentMaxWidth,
+ mx: "auto",
+ mt: 1,
+ mb: 2.25,
+ }}
>
- {onBack && (
- <IconButton
- aria-label="Back"
- onClick={onBack}
- sx={{
- alignSelf: "center",
- width: 44,
- height: 44,
- flexShrink: 0,
- color: "text.secondary",
- border: "1px solid rgba(255, 255, 255, 0.10)",
- backgroundColor: "rgba(255, 255, 255, 0.03)",
- "&:hover": {
- backgroundColor: "rgba(255, 255, 255, 0.08)",
- },
- }}
- >
- <ArrowBackRoundedIcon sx={{ fontSize: 20 }} />
- </IconButton>
- )}
<Box sx={{ minWidth: 0 }}>
<Typography
variant="h3"
@@ -1413,14 +1467,18 @@ const SectionHeader: React.FC<{
>
{title}
</Typography>
- <Typography variant="small" sx={{ color: "text.muted", mt: 1 }}>
- {countLabel}
- </Typography>
+ {countLabel && (
+ <Typography
+ variant="small"
+ sx={{ color: "text.muted", mt: 1 }}
+ >
+ {countLabel}
+ </Typography>
+ )}
</Box>
+ {action}
</Stack>
- {action}
- </Stack>
-);
+ );
const ItemsSection: React.FC<{
items: LockerItem[];
@@ -1710,7 +1768,7 @@ const CollectionGrid: React.FC<{
maxWidth: lockerContentMaxWidth,
mx: "auto",
display: "grid",
- gap: 2,
+ gap: 1,
}}
>
{collections.map((collection) => (
@@ -1982,17 +2040,38 @@ const CollectionFilterChip: React.FC<{
</Tooltip>
);
-const EmptyState: React.FC<{ title: string; subtitle: string }> = ({
- title,
- subtitle,
-}) => (
+const EmptyState: React.FC<{
+ title: string;
+ subtitle?: string;
+ image?: { src: string; alt?: string };
+}> = ({ title, subtitle, image }) => (
<Box sx={{ textAlign: "center", py: 8 }}>
- <Typography variant="h4" sx={{ mb: 0.5 }}>
- {title}
- </Typography>
- <Typography variant="body" sx={{ color: "text.muted" }}>
- {subtitle}
- </Typography>
+ {image && (
+ <img
+ src={image.src}
+ alt={image.alt ?? ""}
+ style={{
+ height: 112,
+ width: "auto",
+ display: "block",
+ margin: "0 auto",
+ }}
+ />
+ )}
+ {image ? (
+ <Typography sx={{ ...lockerTextLargeSx, mt: 2.5, mb: 0.5 }}>
+ {title}
+ </Typography>
+ ) : (
+ <Typography variant="h4" sx={{ mb: 0.5 }}>
+ {title}
+ </Typography>
+ )}
+ {subtitle && (
+ <Typography variant="body" sx={{ color: "text.muted" }}>
+ {subtitle}
+ </Typography>
+ )}
</Box>
);
@@ -2013,42 +2092,20 @@ const CollectionCard: React.FC<{
display: "flex",
alignItems: "center",
justifyContent: "space-between",
- gap: 1.25,
- px: 1.5,
- py: 1.25,
- minHeight: 84,
+ gap: 1.5,
+ pl: 1.5,
+ pr: 0,
+ py: 1.5,
borderRadius: "20px",
- backgroundColor:
- collection.items.length > 0
- ? theme.vars.palette.fill.faint
- : "rgba(255, 255, 255, 0.03)",
- border: 1,
- borderStyle: "solid",
- borderColor:
- collection.items.length > 0
- ? "rgba(255, 255, 255, 0.08)"
- : "rgba(255, 255, 255, 0.08)",
+ border: "1.5px solid",
transition: "background-color 0.15s, border-color 0.15s",
+ ...lockerColorSx(theme, {
+ backgroundColor: "fillLight",
+ borderColor: "fillLight",
+ }),
"&:hover": {
- backgroundColor:
- collection.items.length > 0
- ? theme.vars.palette.fill.faintHover
- : "rgba(255, 255, 255, 0.05)",
- borderColor: "rgba(255, 255, 255, 0.13)",
+ ...lockerColorSx(theme, { backgroundColor: "fillDark" }),
},
- ...theme.applyStyles("light", {
- backgroundColor:
- collection.items.length > 0 ? "#FFFFFF" : "#F8FAFC",
- borderColor:
- collection.items.length > 0
- ? "rgba(17, 24, 39, 0.08)"
- : "rgba(17, 24, 39, 0.06)",
- "&:hover": {
- backgroundColor:
- collection.items.length > 0 ? "#FFFFFF" : "#F1F5F9",
- borderColor: "rgba(17, 24, 39, 0.12)",
- },
- }),
})}
>
<Stack
@@ -2056,58 +2113,66 @@ const CollectionCard: React.FC<{
sx={{ flex: 1, minWidth: 0, alignItems: "center", gap: 1.25 }}
>
<Box
- sx={{
+ sx={(theme) => ({
position: "relative",
display: "flex",
alignItems: "center",
justifyContent: "center",
- width: 52,
- height: 52,
+ width: 40,
+ height: 40,
flexShrink: 0,
- }}
+ borderRadius: "12px",
+ ...lockerColorSx(theme, {
+ backgroundColor: "backgroundBase",
+ }),
+ })}
>
- <Box
- sx={{
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- width: 40,
- height: 40,
- m: "6px",
- borderRadius: "12px",
- backgroundColor: isImportantCollection(collection)
- ? "rgba(16, 113, 255, 0.16)"
- : "rgba(18, 36, 63, 0.96)",
- border: isImportantCollection(collection)
- ? "none"
- : "1px solid rgba(159, 193, 255, 0.12)",
- }}
- >
- {isImportantCollection(collection) ? (
- <StarIcon sx={{ fontSize: 20, color: "#1071FF" }} />
- ) : (
- <FolderOutlinedIcon
- sx={{ fontSize: 20, color: "#D6E5FF" }}
+ {isImportantCollection(collection) ? (
+ <Box
+ sx={(theme) => ({
+ display: "flex",
+ ...lockerColorSx(theme, { color: "primary" }),
+ })}
+ >
+ <HugeiconsIcon
+ icon={StarIcon}
+ size={24}
+ strokeWidth={1.5}
/>
- )}
- </Box>
+ </Box>
+ ) : (
+ <Box
+ sx={(theme) => ({
+ display: "flex",
+ ...lockerColorSx(theme, { color: "textBase" }),
+ })}
+ >
+ <HugeiconsIcon
+ icon={Wallet05Icon}
+ size={24}
+ strokeWidth={1.5}
+ />
+ </Box>
+ )}
{collection.isShared && <SharedCollectionBadge />}
</Box>
<Box sx={{ flex: 1, minWidth: 0 }}>
<Typography
- variant="body"
- sx={{
+ sx={(theme) => ({
+ ...lockerTextBodySx,
minWidth: 0,
- fontWeight: "regular",
- lineHeight: 1.45,
- }}
+ ...lockerColorSx(theme, { color: "textBase" }),
+ })}
noWrap
>
{collection.name}
</Typography>
<Typography
- variant="small"
- sx={{ color: "text.muted", mt: 0.25 }}
+ sx={(theme) => ({
+ ...lockerTextMiniSx,
+ mt: "4px",
+ ...lockerColorSx(theme, { color: "textLight" }),
+ })}
>
{t("lockerItemsCount", {
count: collection.items.length,
@@ -2115,11 +2180,19 @@ const CollectionCard: React.FC<{
</Typography>
</Box>
</Stack>
- {(onShare || onLeave || onRename || onDelete) && (
- <Box
- sx={{ flexShrink: 0, ml: 0.25 }}
- onClick={(event) => event.stopPropagation()}
- >
+ <Box
+ sx={{
+ flexShrink: 0,
+ mr: 1.5,
+ width: 44,
+ height: 24,
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "flex-end",
+ }}
+ onClick={(event) => event.stopPropagation()}
+ >
+ {(onShare || onLeave || onRename || onDelete) && (
<CollectionContextMenu
ariaID={`collection-context-menu-${collection.id}`}
onShare={onShare}
@@ -2127,8 +2200,8 @@ const CollectionCard: React.FC<{
onRename={onRename}
onDelete={onDelete}
/>
- </Box>
- )}
+ )}
+ </Box>
</ButtonBase>
);
};
@@ -2138,20 +2211,21 @@ const SharedCollectionBadge: React.FC = () => {
<Box
sx={(theme) => ({
position: "absolute",
- right: -2,
- bottom: -2,
+ right: -4,
+ bottom: -4,
+ width: 18,
+ height: 18,
+ borderRadius: "50%",
display: "flex",
alignItems: "center",
justifyContent: "center",
- width: 16,
- height: 16,
- borderRadius: "999px",
- backgroundColor: "#1071FF",
- border: `1.5px solid ${theme.vars.palette.background.paper}`,
- boxShadow: "0 2px 6px rgba(0, 66, 173, 0.24)",
+ ...lockerColorSx(theme, {
+ backgroundColor: "fillLight",
+ color: "primary",
+ }),
})}
>
- <ShareOutlinedIcon sx={{ fontSize: 10, color: "#FFFFFF" }} />
+ <HugeiconsIcon icon={Link01Icon} size={12} strokeWidth={2} />
</Box>
);
};
@@ -2165,12 +2239,7 @@ const CollectionContextMenu: React.FC<{
}> = ({ ariaID, onShare, onLeave, onRename, onDelete }) => (
<OverflowMenu
ariaID={ariaID}
- triggerButtonSxProps={{
- p: 0.25,
- color: "text.faint",
- opacity: 0,
- ".MuiButtonBase-root:hover &": { opacity: 1 },
- }}
+ triggerButtonSxProps={{ p: 0.25, color: "text.muted" }}
>
{onShare && (
<OverflowMenuOption
diff --git a/web/apps/locker/src/components/createItemDialog/ItemFormFields.tsx b/web/apps/locker/src/components/createItemDialog/ItemFormFields.tsx
index decd13ed93..0293a8114b 100644
--- a/web/apps/locker/src/components/createItemDialog/ItemFormFields.tsx
+++ b/web/apps/locker/src/components/createItemDialog/ItemFormFields.tsx
@@ -21,7 +21,7 @@ type FormFieldProps = Omit<TextFieldProps, "label"> & {
multilineMinHeight?: number;
};
-function FormField({
+export function FormField({
label,
required,
multiline,
diff --git a/web/apps/locker/src/components/itemList/ItemListDialogs.tsx b/web/apps/locker/src/components/itemList/ItemListDialogs.tsx
index be64efe9f9..0c9b07abbd 100644
--- a/web/apps/locker/src/components/itemList/ItemListDialogs.tsx
+++ b/web/apps/locker/src/components/itemList/ItemListDialogs.tsx
@@ -1,4 +1,17 @@
+import {
+ lockerHeaderIconButtonSx,
+ lockerPrimaryButtonSx,
+} from "@/components/createItemDialog/create-item-dialog-styles";
+import { FormField } from "@/components/createItemDialog/ItemFormFields";
+import {
+ lockerColorSx,
+ lockerTextBodyBoldSx,
+ lockerTextH2Sx,
+ lockerTextMiniSx,
+} from "@/components/locker-tokens";
import type { LockerCollection } from "@/types";
+import { Cancel01Icon } from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
import CheckCircleRoundedIcon from "@mui/icons-material/CheckCircleRounded";
import {
Box,
@@ -7,18 +20,18 @@ import {
Dialog,
DialogContent,
DialogTitle,
+ IconButton,
Menu,
MenuItem,
Snackbar,
Stack,
- TextField,
Typography,
} from "@mui/material";
import { LoadingButton } from "ente-base/components/mui/LoadingButton";
import { t } from "i18next";
import React from "react";
-import { LockerFileLinkDialog } from "../LockerFileLinkDialog";
import { lockerDialogPaperSx } from "../locker-dialog-styles";
+import { LockerFileLinkDialog } from "../LockerFileLinkDialog";
interface ItemListDialogsProps {
activeFileLinkItemTitle: string;
@@ -228,7 +241,19 @@ export const ItemListDialogs: React.FC<ItemListDialogsProps> = ({
</Dialog>
<Dialog
- slotProps={{ paper: { sx: lockerDialogPaperSx } }}
+ slotProps={{
+ paper: {
+ sx: (theme) => ({
+ ...lockerDialogPaperSx,
+ borderRadius: "24px",
+ width: "min(100%, 440px)",
+ padding: "20px",
+ ...lockerColorSx(theme, {
+ backgroundColor: "backgroundBase",
+ }),
+ }),
+ },
+ }}
open={renameCollectionOpen}
onClose={() => {
if (!renamingCollection) {
@@ -238,14 +263,35 @@ export const ItemListDialogs: React.FC<ItemListDialogsProps> = ({
fullWidth
maxWidth="xs"
>
- <DialogTitle>{t("renameCollection")}</DialogTitle>
- <DialogContent>
- <Stack sx={{ gap: 2, pt: 0.25, pb: 1 }}>
- <TextField
+ <Stack>
+ <Stack
+ direction="row"
+ sx={{ alignItems: "center", gap: 1.5, minHeight: 38 }}
+ >
+ <Typography
+ sx={{ ...lockerTextH2Sx, flex: 1, minWidth: 0 }}
+ >
+ {t("renameCollection")}
+ </Typography>
+ <IconButton
+ aria-label={t("close")}
+ onClick={onCloseRenameDialog}
+ disabled={renamingCollection}
+ sx={lockerHeaderIconButtonSx}
+ >
+ <HugeiconsIcon
+ icon={Cancel01Icon}
+ size={18}
+ strokeWidth={1.5}
+ />
+ </IconButton>
+ </Stack>
+ <Box sx={{ mt: 2.5 }}>
+ <FormField
value={renameValue}
onChange={(event) => setRenameValue(event.target.value)}
label={t("enterCollectionName")}
- fullWidth
+ required
autoFocus
disabled={renamingCollection}
onKeyDown={(event) => {
@@ -254,28 +300,62 @@ export const ItemListDialogs: React.FC<ItemListDialogsProps> = ({
}
}}
/>
- {renameError && (
- <Typography
- variant="small"
- sx={{ color: "critical.main" }}
- >
- {renameError}
- </Typography>
- )}
- <LoadingButton
- variant="contained"
- loading={renamingCollection}
- disabled={!renameValue.trim()}
- onClick={onConfirmRename}
+ </Box>
+ {renameError && (
+ <Typography
+ sx={(theme) => ({
+ ...lockerTextMiniSx,
+ mt: 1.5,
+ ...lockerColorSx(theme, { color: "warning" }),
+ })}
>
- {t("save")}
- </LoadingButton>
- </Stack>
- </DialogContent>
+ {renameError}
+ </Typography>
+ )}
+ <LoadingButton
+ fullWidth
+ color="primary"
+ loading={renamingCollection}
+ disabled={!renameValue.trim()}
+ onClick={onConfirmRename}
+ sx={(theme) => ({
+ ...lockerTextBodyBoldSx,
+ mt: 3,
+ borderRadius: "20px",
+ textTransform: "none",
+ ...lockerColorSx(theme, {
+ backgroundColor: "primary",
+ color: "specialWhite",
+ }),
+ "&:hover": {
+ ...lockerColorSx(theme, {
+ backgroundColor: "primaryDark",
+ }),
+ },
+ ...lockerPrimaryButtonSx(theme, {
+ loading: renamingCollection,
+ }),
+ })}
+ >
+ {t("save")}
+ </LoadingButton>
+ </Stack>
</Dialog>
<Dialog
- slotProps={{ paper: { sx: lockerDialogPaperSx } }}
+ slotProps={{
+ paper: {
+ sx: (theme) => ({
+ ...lockerDialogPaperSx,
+ borderRadius: "24px",
+ width: "min(100%, 440px)",
+ padding: "20px",
+ ...lockerColorSx(theme, {
+ backgroundColor: "backgroundBase",
+ }),
+ }),
+ },
+ }}
open={createCollectionOpen}
onClose={() => {
if (!creatingCollection) {
@@ -285,16 +365,37 @@ export const ItemListDialogs: React.FC<ItemListDialogsProps> = ({
fullWidth
maxWidth="xs"
>
- <DialogTitle>{t("createCollection")}</DialogTitle>
- <DialogContent>
- <Stack sx={{ gap: 2, pt: 0.25, pb: 1 }}>
- <TextField
+ <Stack>
+ <Stack
+ direction="row"
+ sx={{ alignItems: "center", gap: 1.5, minHeight: 38 }}
+ >
+ <Typography
+ sx={{ ...lockerTextH2Sx, flex: 1, minWidth: 0 }}
+ >
+ {t("createCollection")}
+ </Typography>
+ <IconButton
+ aria-label={t("close")}
+ onClick={onCloseCreateCollectionDialog}
+ disabled={creatingCollection}
+ sx={lockerHeaderIconButtonSx}
+ >
+ <HugeiconsIcon
+ icon={Cancel01Icon}
+ size={18}
+ strokeWidth={1.5}
+ />
+ </IconButton>
+ </Stack>
+ <Box sx={{ mt: 2.5 }}>
+ <FormField
value={createCollectionName}
onChange={(event) =>
setCreateCollectionName(event.target.value)
}
label={t("enterCollectionName")}
- fullWidth
+ required
autoFocus
disabled={creatingCollection}
onKeyDown={(event) => {
@@ -303,35 +404,46 @@ export const ItemListDialogs: React.FC<ItemListDialogsProps> = ({
}
}}
/>
- {createCollectionError && (
- <Typography
- variant="small"
- sx={{ color: "critical.main" }}
- >
- {createCollectionError}
- </Typography>
- )}
- <Stack direction="row" sx={{ gap: 1 }}>
- <Button
- fullWidth
- color="secondary"
- onClick={onCloseCreateCollectionDialog}
- disabled={creatingCollection}
- >
- {t("cancel")}
- </Button>
- <LoadingButton
- fullWidth
- color="primary"
- loading={creatingCollection}
- onClick={onConfirmCreateCollection}
- disabled={!createCollectionName.trim()}
- >
- {t("createCollectionButton")}
- </LoadingButton>
- </Stack>
- </Stack>
- </DialogContent>
+ </Box>
+ {createCollectionError && (
+ <Typography
+ sx={(theme) => ({
+ ...lockerTextMiniSx,
+ mt: 1.5,
+ ...lockerColorSx(theme, { color: "warning" }),
+ })}
+ >
+ {createCollectionError}
+ </Typography>
+ )}
+ <LoadingButton
+ fullWidth
+ color="primary"
+ loading={creatingCollection}
+ disabled={!createCollectionName.trim()}
+ onClick={onConfirmCreateCollection}
+ sx={(theme) => ({
+ ...lockerTextBodyBoldSx,
+ mt: 3,
+ borderRadius: "20px",
+ textTransform: "none",
+ ...lockerColorSx(theme, {
+ backgroundColor: "primary",
+ color: "specialWhite",
+ }),
+ "&:hover": {
+ ...lockerColorSx(theme, {
+ backgroundColor: "primaryDark",
+ }),
+ },
+ ...lockerPrimaryButtonSx(theme, {
+ loading: creatingCollection,
+ }),
+ })}
+ >
+ {t("createCollectionButton")}
+ </LoadingButton>
+ </Stack>
</Dialog>
<Menu
diff --git a/web/apps/locker/src/components/locker-tokens.ts b/web/apps/locker/src/components/locker-tokens.ts
index 5febd9130b..11e078ece5 100644
--- a/web/apps/locker/src/components/locker-tokens.ts
+++ b/web/apps/locker/src/components/locker-tokens.ts
@@ -12,6 +12,8 @@ export const lockerColors = {
iconColor: { light: "rgba(0, 0, 0, 0.75)", dark: "#ffffff" },
primary: { light: "#1071ff", dark: "#1071ff" },
primaryDark: { light: "#0e5fd9", dark: "#0e5fd9" },
+ warning: { light: "#f63a3a", dark: "#f63a3a" },
+ warningDark: { light: "#dd3434", dark: "#dd3434" },
specialWhite: { light: "#ffffff", dark: "#ffffff" },
} as const;
@@ -40,3 +42,34 @@ export const lockerTextBodySx = {
lineHeight: "20px",
fontWeight: 500,
};
+
+// Mirrors the Locker design-system text styles.
+export const lockerTextDisplay2Sx = {
+ fontSize: "24px",
+ lineHeight: "32px",
+ fontWeight: 600,
+};
+
+export const lockerTextH2Sx = {
+ fontSize: "18px",
+ lineHeight: "24px",
+ fontWeight: 600,
+};
+
+export const lockerTextLargeSx = {
+ fontSize: "16px",
+ lineHeight: "20px",
+ fontWeight: 600,
+};
+
+export const lockerTextBodyBoldSx = {
+ fontSize: "14px",
+ lineHeight: "20px",
+ fontWeight: 600,
+};
+
+export const lockerTextMiniSx = {
+ fontSize: "12px",
+ lineHeight: "16px",
+ fontWeight: 500,
+};
diff --git a/web/apps/locker/src/components/lockerPage/DeleteCollectionDialog.tsx b/web/apps/locker/src/components/lockerPage/DeleteCollectionDialog.tsx
index 21838bb17c..ba106a619d 100644
--- a/web/apps/locker/src/components/lockerPage/DeleteCollectionDialog.tsx
+++ b/web/apps/locker/src/components/lockerPage/DeleteCollectionDialog.tsx
@@ -1,14 +1,22 @@
import { lockerDialogPaperSx } from "@/components/locker-dialog-styles";
import {
+ lockerColorSx,
+ lockerTextBodyBoldSx,
+ lockerTextBodySx,
+ lockerTextH2Sx,
+ lockerTextMiniSx,
+} from "@/components/locker-tokens";
+import { Cancel01Icon } from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
+import {
+ Box,
Checkbox,
Dialog,
- DialogContent,
- DialogTitle,
FormControlLabel,
+ IconButton,
Stack,
Typography,
} from "@mui/material";
-import { FocusVisibleButton } from "ente-base/components/mui/FocusVisibleButton";
import { LoadingButton } from "ente-base/components/mui/LoadingButton";
import { t } from "i18next";
import React from "react";
@@ -40,20 +48,79 @@ export const DeleteCollectionDialog: React.FC<DeleteCollectionDialogProps> = ({
maxWidth="xs"
slotProps={{
paper: {
- sx: { ...lockerDialogPaperSx, width: "min(100%, 420px)" },
+ sx: (theme) => ({
+ ...lockerDialogPaperSx,
+ borderRadius: "24px",
+ width: "min(100%, 440px)",
+ padding: "20px",
+ ...lockerColorSx(theme, {
+ backgroundColor: "backgroundBase",
+ }),
+ }),
},
}}
>
- <DialogTitle sx={{ pb: 1 }}>{t("deleteCollectionTitle")}</DialogTitle>
- <DialogContent>
- <Stack sx={{ gap: 2.25 }}>
- <Typography sx={{ color: "text.muted" }}>
- {t("deleteCollectionDialogBody", {
- collectionName:
- visibleDialogState?.collectionName ?? "",
+ <Stack>
+ <Box sx={{ display: "flex", justifyContent: "flex-end" }}>
+ <IconButton
+ aria-label={t("cancel")}
+ onClick={onClose}
+ disabled={visibleDialogState?.loading}
+ sx={(theme) => ({
+ width: 36,
+ height: 36,
+ borderRadius: "50%",
+ padding: 0,
+ ...lockerColorSx(theme, {
+ backgroundColor: "fillLight",
+ color: "iconColor",
+ }),
+ "&:hover": {
+ ...lockerColorSx(theme, {
+ backgroundColor: "fillDark",
+ }),
+ },
})}
- </Typography>
- {visibleDialogState?.hasItems && (
+ >
+ <HugeiconsIcon
+ icon={Cancel01Icon}
+ size={18}
+ strokeWidth={1.5}
+ />
+ </IconButton>
+ </Box>
+ <img
+ src="/images/collection_delete_icon.png"
+ alt=""
+ style={{
+ width: 120,
+ height: 120,
+ objectFit: "contain",
+ display: "block",
+ margin: "4px auto 0",
+ }}
+ />
+ <Typography
+ sx={{ ...lockerTextH2Sx, textAlign: "center", mt: 2.5 }}
+ >
+ {t("deleteCollectionTitle")}
+ </Typography>
+ <Typography
+ sx={(theme) => ({
+ ...lockerTextBodySx,
+ textAlign: "center",
+ mt: 1.5,
+ ...lockerColorSx(theme, { color: "textLight" }),
+ })}
+ >
+ {t("deleteCollectionDialogBody", {
+ collectionName: visibleDialogState?.collectionName ?? "",
+ })}
+ </Typography>
+ {visibleDialogState?.hasItems && (
+ <Box
+ sx={{ display: "flex", mt: 2.5, justifyContent: "center" }}
+ >
<FormControlLabel
control={
<Checkbox
@@ -69,33 +136,56 @@ export const DeleteCollectionDialog: React.FC<DeleteCollectionDialogProps> = ({
/>
}
label={t("deleteCollectionFromEverywhere")}
- sx={{ alignItems: "center", m: 0 }}
+ sx={{
+ alignItems: "center",
+ m: 0,
+ "& .MuiFormControlLabel-label": lockerTextBodySx,
+ }}
/>
- )}
- {visibleDialogState?.error && (
- <Typography variant="small" sx={{ color: "critical.main" }}>
- {visibleDialogState.error}
- </Typography>
- )}
- <Stack direction="row" sx={{ gap: 1 }}>
- <FocusVisibleButton
- fullWidth
- color="secondary"
- disabled={visibleDialogState?.loading}
- onClick={onClose}
- >
- {t("cancel")}
- </FocusVisibleButton>
- <LoadingButton
- fullWidth
- color="critical"
- loading={visibleDialogState?.loading}
- onClick={onConfirm}
- >
- {t("delete")}
- </LoadingButton>
- </Stack>
- </Stack>
- </DialogContent>
+ </Box>
+ )}
+ {visibleDialogState?.error && (
+ <Typography
+ sx={(theme) => ({
+ ...lockerTextMiniSx,
+ textAlign: "center",
+ mt: 1.5,
+ ...lockerColorSx(theme, { color: "warning" }),
+ })}
+ >
+ {visibleDialogState.error}
+ </Typography>
+ )}
+ <LoadingButton
+ fullWidth
+ color="critical"
+ loading={visibleDialogState?.loading}
+ onClick={onConfirm}
+ sx={(theme) => ({
+ ...lockerTextBodyBoldSx,
+ mt: 3,
+ minHeight: 52,
+ borderRadius: "20px",
+ textTransform: "none",
+ ...lockerColorSx(theme, {
+ backgroundColor: "warning",
+ color: "specialWhite",
+ }),
+ "&:hover": {
+ ...lockerColorSx(theme, {
+ backgroundColor: "warningDark",
+ }),
+ },
+ "&.Mui-disabled": {
+ ...lockerColorSx(theme, {
+ backgroundColor: "warning",
+ color: "specialWhite",
+ }),
+ },
+ })}
+ >
+ {t("delete")}
+ </LoadingButton>
+ </Stack>
</Dialog>
);