Skip to content

armgit / ente

Public Imported from GitHub
0

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

Trim

Manav Rathid244ce21f009
diff --git a/web/apps/photos/src/components/pages/gallery/SelectedFileOptions.tsx b/web/apps/photos/src/components/pages/gallery/SelectedFileOptions.tsx
index 08111b33c6..3f5b271d77 100644
--- a/web/apps/photos/src/components/pages/gallery/SelectedFileOptions.tsx
+++ b/web/apps/photos/src/components/pages/gallery/SelectedFileOptions.tsx
@@ -1,4 +1,3 @@
-import { NavbarBaseNormalFlow, SelectionBar } from "@/base/components/Navbar";
import type { Collection } from "@/media/collection";
import type { CollectionSelectorAttributes } from "@/new/photos/components/CollectionSelector";
import type { GalleryBarMode } from "@/new/photos/components/gallery/reducer";
diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsx
index ab7c1f1bbe..841e925afd 100644
--- a/web/apps/photos/src/pages/shared-albums.tsx
+++ b/web/apps/photos/src/pages/shared-albums.tsx
@@ -10,7 +10,7 @@ import {
} from "@/base/components/loaders";
import type { ButtonishProps } from "@/base/components/mui";
import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
-import { NavbarBaseNormalFlow, SelectionBar } from "@/base/components/Navbar";
+import { NavbarBaseNormalFlow } from "@/base/components/Navbar";
import {
OverflowMenu,
OverflowMenuOption,
@@ -515,7 +515,33 @@ export default function PublicCollectionGallery() {
getFolderSelectorInputProps,
}}
/>
- <SharedAlbumNavbar onAddPhotos={onAddPhotos} />
+ <NavbarBaseNormalFlow
+ sx={{
+ mb: "16px",
+ px: "24px",
+ "@media (width < 720px)": { px: "4px" },
+ }}
+ >
+ {selected.count > 0 ? (
+ <SelectedFileOptions
+ downloadFilesHelper={downloadFilesHelper}
+ clearSelection={clearSelection}
+ count={selected.count}
+ />
+ ) : (
+ <SpacedRow sx={{ flex: 1 }}>
+ <EnteLogoLink href="https://ente.io">
+ <EnteLogo height={15} />
+ </EnteLogoLink>
+ {onAddPhotos ? (
+ <AddPhotosButton onClick={onAddPhotos} />
+ ) : (
+ <GoToEnte />
+ )}
+ </SpacedRow>
+ )}
+ </NavbarBaseNormalFlow>
+
<PhotoFrame
files={publicFiles}
syncWithRemote={syncWithRemote}
@@ -555,49 +581,11 @@ export default function PublicCollectionGallery() {
attributesList={filesDownloadProgressAttributesList}
setAttributesList={setFilesDownloadProgressAttributesList}
/>
- {selected.count > 0 && (
- <SelectedFileOptions
- downloadFilesHelper={downloadFilesHelper}
- clearSelection={clearSelection}
- count={selected.count}
- />
- )}
</FullScreenDropZone>
</PublicCollectionGalleryContext.Provider>
);
}
-interface SharedAlbumNavbarProps {
- /**
- * If provided, then an "Add Photos" button will be shown in the navbar, and
- * this function will be called when it is clicked.
- */
- onAddPhotos: (() => void) | undefined;
-}
-
-const SharedAlbumNavbar: React.FC<SharedAlbumNavbarProps> = ({
- onAddPhotos,
-}) => (
- <NavbarBaseNormalFlow
- sx={{
- mb: "16px",
- px: "24px",
- "@media (width < 720px)": { px: "4px" },
- }}
- >
- <SpacedRow sx={{ flex: 1 }}>
- <EnteLogoLink href="https://ente.io">
- <EnteLogo height={15} />
- </EnteLogoLink>
- {onAddPhotos ? (
- <AddPhotosButton onClick={onAddPhotos} />
- ) : (
- <GoToEnte />
- )}
- </SpacedRow>
- </NavbarBaseNormalFlow>
-);
-
const EnteLogoLink = styled("a")(({ theme }) => ({
// Remove the excess space at the top.
svg: { verticalAlign: "middle" },
@@ -671,7 +659,7 @@ const SelectedFileOptions: React.FC<SelectedFileOptionsProps> = ({
clearSelection,
}) => {
return (
- <SelectionBar>
+ <>
<FluidContainer>
<IconButton onClick={clearSelection}>
<CloseIcon />
@@ -687,7 +675,7 @@ const SelectedFileOptions: React.FC<SelectedFileOptionsProps> = ({
</IconButton>
</Tooltip>
</Stack>
- </SelectionBar>
+ </>
);
};
diff --git a/web/packages/base/components/Navbar.tsx b/web/packages/base/components/Navbar.tsx
index 0e49f12fed..c947375225 100644
--- a/web/packages/base/components/Navbar.tsx
+++ b/web/packages/base/components/Navbar.tsx
@@ -1,33 +1,7 @@
import { EnteLogo } from "@/base/components/EnteLogo";
-import { FlexWrapper } from "@ente/shared/components/Container";
import { styled } from "@mui/material";
import React from "react";
-/**
- * The "bar" at the top of the screen.
- *
- * Usually this area contains the App's main navigation bar ({@link AppNavbar}),
- * but depending on the context it can also show the {@link SelectionBar}.
- *
- * TODO: Deprecated. Use NavbarBaseNormalFlow instead.
- */
-export const NavbarBase2 = styled(FlexWrapper)(
- ({ theme }) => `
- min-height: 64px;
- position: sticky;
- top: 0;
- left: 0;
- z-index: 10;
- border-bottom: 1px solid ${theme.vars.palette.divider};
- background-color: ${theme.vars.palette.background.default};
- margin-bottom: 16px;
- padding: 0 24px;
- @media (max-width: 720px) {
- padding: 0 4px;
- }
-`,
-);
-
export const NavbarBaseNormalFlow = styled("div")(
({ theme }) => `
flex: 0 0 64px;
@@ -38,16 +12,6 @@ export const NavbarBaseNormalFlow = styled("div")(
`,
);
-export const NavbarBase = styled(NavbarBaseNormalFlow)(({ theme }) => ({
- position: "sticky",
- top: 0,
- left: 0,
- mb: theme.spacing(2),
- zIndex: 1,
- backgroundColor: "transparent",
- // backdropFilter: "blur(7px)",
-}));
-
/**
* A variant of AppNavbar that places itself normally in the document flow
* instead of using a fixed positioning.
@@ -57,8 +21,3 @@ export const AppNavbarNormalFlow: React.FC = () => (
<EnteLogo />
</NavbarBaseNormalFlow>
);
-
-export const SelectionBar = styled(NavbarBase2)`
- position: fixed;
- z-index: 12;
-`;