From d9bd79e5efac32fbedaec12a8334d83897488c36 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 29 Nov 2024 14:32:47 +0530 Subject: [PATCH] Default --- web/apps/auth/src/pages/auth.tsx | 6 +----- web/apps/photos/src/components/Export.tsx | 7 +------ web/apps/photos/src/components/WatchFolder.tsx | 2 -- web/apps/photos/src/pages/shared-albums.tsx | 6 +----- .../photos/components/gallery/PeopleHeader.tsx | 16 +++------------- web/packages/shared/components/OverflowMenu.tsx | 7 +++++-- 6 files changed, 11 insertions(+), 33 deletions(-) diff --git a/web/apps/auth/src/pages/auth.tsx b/web/apps/auth/src/pages/auth.tsx index 9297a1c5ea..9c0502d46a 100644 --- a/web/apps/auth/src/pages/auth.tsx +++ b/web/apps/auth/src/pages/auth.tsx @@ -16,7 +16,6 @@ import { } from "@ente/shared/components/OverflowMenu"; import { AUTH_PAGES as PAGES } from "@ente/shared/constants/pages"; import LogoutOutlined from "@mui/icons-material/LogoutOutlined"; -import MoreHoriz from "@mui/icons-material/MoreHoriz"; import { Button, ButtonBase, @@ -155,10 +154,7 @@ const AuthNavbar: React.FC = () => { - } - > + } diff --git a/web/apps/photos/src/components/Export.tsx b/web/apps/photos/src/components/Export.tsx index f7283e539c..2f6f4b71d9 100644 --- a/web/apps/photos/src/components/Export.tsx +++ b/web/apps/photos/src/components/Export.tsx @@ -18,7 +18,6 @@ import { } from "@ente/shared/components/OverflowMenu"; import { CustomError } from "@ente/shared/error"; import FolderIcon from "@mui/icons-material/Folder"; -import MoreHoriz from "@mui/icons-material/MoreHoriz"; import { Box, Button, @@ -269,11 +268,7 @@ const DirectoryPathContainer = styled(LinkButton)( ); const ChangeDirectoryOption: React.FC = ({ onClick }) => ( - } - triggerButtonProps={{ sx: { ml: 1 } }} - > + }> {t("CHANGE_FOLDER")} diff --git a/web/apps/photos/src/components/WatchFolder.tsx b/web/apps/photos/src/components/WatchFolder.tsx index 5913e04a77..c80d336412 100644 --- a/web/apps/photos/src/components/WatchFolder.tsx +++ b/web/apps/photos/src/components/WatchFolder.tsx @@ -23,7 +23,6 @@ import CheckIcon from "@mui/icons-material/Check"; import DoNotDisturbOutlinedIcon from "@mui/icons-material/DoNotDisturbOutlined"; import FolderCopyOutlinedIcon from "@mui/icons-material/FolderCopyOutlined"; import FolderOpenIcon from "@mui/icons-material/FolderOpen"; -import MoreHorizIcon from "@mui/icons-material/MoreHoriz"; import { Box, Button, @@ -312,7 +311,6 @@ const EntryOptions: React.FC = ({ confirmStopWatching }) => { return ( } menuPaperProps={{ sx: { backgroundColor: (theme) => diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsx index 48afe2ee5a..7c1664e765 100644 --- a/web/apps/photos/src/pages/shared-albums.tsx +++ b/web/apps/photos/src/pages/shared-albums.tsx @@ -44,7 +44,6 @@ import AddPhotoAlternateOutlined from "@mui/icons-material/AddPhotoAlternateOutl import CloseIcon from "@mui/icons-material/Close"; import DownloadIcon from "@mui/icons-material/Download"; import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined"; -import MoreHoriz from "@mui/icons-material/MoreHoriz"; import type { ButtonProps, IconButtonProps } from "@mui/material"; import { Box, Button, IconButton, Stack, styled, Tooltip } from "@mui/material"; import Typography from "@mui/material/Typography"; @@ -715,10 +714,7 @@ const ListHeader: React.FC = ({ fileCount={publicFiles.length} /> {downloadEnabled && ( - } - > + } onClick={downloadAllFiles} diff --git a/web/packages/new/photos/components/gallery/PeopleHeader.tsx b/web/packages/new/photos/components/gallery/PeopleHeader.tsx index 7f96b89d3a..73a2e680f6 100644 --- a/web/packages/new/photos/components/gallery/PeopleHeader.tsx +++ b/web/packages/new/photos/components/gallery/PeopleHeader.tsx @@ -40,7 +40,6 @@ import ClearIcon from "@mui/icons-material/Clear"; import EditIcon from "@mui/icons-material/Edit"; import HideImageOutlinedIcon from "@mui/icons-material/HideImageOutlined"; import ListAltOutlinedIcon from "@mui/icons-material/ListAltOutlined"; -import MoreHorizIcon from "@mui/icons-material/MoreHoriz"; import RestoreIcon from "@mui/icons-material/Restore"; import VisibilityOutlinedIcon from "@mui/icons-material/VisibilityOutlined"; import { @@ -146,10 +145,7 @@ const CGroupPersonHeader: React.FC = ({ person }) => { name={name} fileCount={person.fileIDs.length} /> - } - > + } centerAlign @@ -210,10 +206,7 @@ const IgnoredPersonHeader: React.FC = ({ nameProps={{ color: "text.muted" }} fileCount={person.fileIDs.length} /> - } - > + } centerAlign @@ -271,10 +264,7 @@ const ClusterPersonHeader: React.FC = ({ - } - > + } centerAlign diff --git a/web/packages/shared/components/OverflowMenu.tsx b/web/packages/shared/components/OverflowMenu.tsx index 65f556b545..545534318f 100644 --- a/web/packages/shared/components/OverflowMenu.tsx +++ b/web/packages/shared/components/OverflowMenu.tsx @@ -10,6 +10,7 @@ import { type PaperProps, } from "@mui/material"; import Menu, { type MenuProps } from "@mui/material/Menu"; +import MoreHorizIcon from "@mui/icons-material/MoreHoriz"; import React, { createContext, useContext, useMemo, useState } from "react"; const OverflowMenuContext = createContext({ @@ -24,8 +25,10 @@ interface OverflowMenuProps { ariaID: string; /** * The icon for the trigger button. + * + * If not provided, then by default the MoreHoriz icon from MUI is used. */ - triggerButtonIcon: React.ReactNode; + triggerButtonIcon?: React.ReactNode; /** * Optional additional properties for the trigger icon button. */ @@ -77,7 +80,7 @@ export const OverflowMenu: React.FC< aria-expanded={anchorEl ? "true" : undefined} {...triggerButtonProps} > - {triggerButtonIcon} + {triggerButtonIcon ?? }