diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx index 3fb092f681..15988a23b7 100644 --- a/web/apps/photos/src/pages/gallery.tsx +++ b/web/apps/photos/src/pages/gallery.tsx @@ -44,13 +44,7 @@ import type { User } from "@ente/shared/user/types"; import ArrowBack from "@mui/icons-material/ArrowBack"; import FileUploadOutlinedIcon from "@mui/icons-material/FileUploadOutlined"; import MenuIcon from "@mui/icons-material/Menu"; -import { - Button, - ButtonProps, - IconButton, - Typography, - styled, -} from "@mui/material"; +import { Button, IconButton, Typography, styled } from "@mui/material"; import AuthenticateUserModal from "components/AuthenticateUserModal"; import Collections from "components/Collections"; import { CollectionInfo } from "components/Collections/CollectionInfo"; @@ -1300,57 +1294,46 @@ const NormalNavbarContents: React.FC = ({ files={files} updateSearch={updateSearch} /> - {!isInSearchMode && } + {!isInSearchMode && } ); }; interface UploadButtonProps { - openUploader: (intent?: UploadTypeSelectorIntent) => void; - text?: string; - color?: ButtonProps["color"]; - disableShrink?: boolean; - icon?: JSX.Element; + onClick: () => void; } -export const UploadButton: React.FC = ({ - openUploader, - text, - color, - disableShrink, - icon, -}) => { - const onClickHandler = () => openUploader(); +export const UploadButton: React.FC = ({ onClick }) => { + const disabled = !uploadManager.shouldAllowNewUpload(); return ( - {icon ?? } + {} ); }; -const UploadButton_ = styled("div")<{ $disableShrink: boolean }>` +const UploadButton_ = styled("div")` display: flex; align-items: center; justify-content: center; @@ -1359,16 +1342,14 @@ const UploadButton_ = styled("div")<{ $disableShrink: boolean }>` & .mobile-button { display: none; } - ${({ $disableShrink }) => - !$disableShrink && - `@media (max-width: 624px) { + @media (max-width: 624px) { & .mobile-button { display: inline-flex; } & .desktop-button { display: none; } - }`} + } `; interface HiddenSectionNavbarContentsProps {