Skip to content

armgit / ente

Public Imported from GitHub
0

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

Replace collection header icons and rename notifications to feed

Anand Baburajan1f731eabecbd
diff --git a/web/apps/photos/src/components/Collections/CollectionHeader.tsx b/web/apps/photos/src/components/Collections/CollectionHeader.tsx
index 52a0b9da3d..81e18744a8 100644
--- a/web/apps/photos/src/components/Collections/CollectionHeader.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionHeader.tsx
@@ -1,11 +1,9 @@
import ArchiveOutlinedIcon from "@mui/icons-material/ArchiveOutlined";
import DeleteOutlinedIcon from "@mui/icons-material/DeleteOutlined";
import EditIcon from "@mui/icons-material/Edit";
-import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";
import LinkIcon from "@mui/icons-material/Link";
import LogoutIcon from "@mui/icons-material/Logout";
import MoreHorizIcon from "@mui/icons-material/MoreHoriz";
-import PeopleIcon from "@mui/icons-material/People";
import PushPinIcon from "@mui/icons-material/PushPin";
import PushPinOutlinedIcon from "@mui/icons-material/PushPinOutlined";
import SortIcon from "@mui/icons-material/Sort";
@@ -73,7 +71,7 @@ export interface CollectionHeaderProps {
onRemotePull: (opts?: RemotePullOpts) => Promise<void>;
onCollectionShare: () => void;
onCollectionCast: () => void;
- onCollectionNotifications: () => void;
+ onCollectionFeed: () => void;
/**
* A function that can be used to create a UI notification to track the
* progress of user-initiated download, and to cancel it if needed.
@@ -93,7 +91,7 @@ export const CollectionHeader: React.FC<CollectionHeaderProps> = (props) => {
const EndIcon = () => {
if (attributes.has("archived")) return <ArchiveOutlinedIcon />;
if (attributes.has("sharedOnlyViaLink")) return <LinkIcon />;
- if (attributes.has("shared")) return <PeopleIcon />;
+ if (attributes.has("shared")) return <ShareIcon />;
if (attributes.has("userFavorites"))
return <StarIcon fontSize="small" />;
return <></>;
@@ -125,7 +123,7 @@ const CollectionHeaderOptions: React.FC<CollectionHeaderProps> = ({
onRemotePull,
onCollectionShare,
onCollectionCast,
- onCollectionNotifications,
+ onCollectionFeed,
onAddSaveGroup,
isActiveCollectionDownloadInProgress,
}) => {
@@ -374,7 +372,7 @@ const CollectionHeaderOptions: React.FC<CollectionHeaderProps> = ({
<OverflowMenuOption
key="share"
onClick={onCollectionShare}
- startIcon={<PeopleIcon />}
+ startIcon={<ShareIcon />}
>
{t("share_favorites")}
</OverflowMenuOption>,
@@ -528,7 +526,7 @@ const CollectionHeaderOptions: React.FC<CollectionHeaderProps> = ({
<OverflowMenuOption
key="share"
onClick={onCollectionShare}
- startIcon={<PeopleIcon />}
+ startIcon={<ShareIcon />}
>
{t("share_album")}
</OverflowMenuOption>,
@@ -552,7 +550,7 @@ const CollectionHeaderOptions: React.FC<CollectionHeaderProps> = ({
isDownloadInProgress={isActiveCollectionDownloadInProgress}
onEmptyTrashClick={confirmEmptyTrash}
onDownloadClick={downloadCollection}
- onNotificationsClick={onCollectionNotifications}
+ onFeedClick={onCollectionFeed}
onShareClick={onCollectionShare}
/>
{validMenuOptions.length > 0 && (
@@ -596,14 +594,14 @@ interface QuickOptionsProps {
isDownloadInProgress: () => boolean;
onEmptyTrashClick: () => void;
onDownloadClick: () => void;
- onNotificationsClick: () => void;
+ onFeedClick: () => void;
onShareClick: () => void;
}
const QuickOptions: React.FC<QuickOptionsProps> = ({
onEmptyTrashClick,
onDownloadClick,
- onNotificationsClick,
+ onFeedClick,
onShareClick,
collectionSummary,
isDownloadInProgress,
@@ -622,15 +620,15 @@ const QuickOptions: React.FC<QuickOptionsProps> = ({
onClick={onDownloadClick}
/>
))}
- {showNotificationsQuickOption(collectionSummary) && (
- <NotificationsQuickOption onClick={onNotificationsClick} />
- )}
{showShareQuickOption(collectionSummary) && (
<ShareQuickOption
collectionSummary={collectionSummary}
onClick={onShareClick}
/>
)}
+ {showFeedQuickOption(collectionSummary) && (
+ <FeedQuickOption onClick={onFeedClick} />
+ )}
</Stack>
);
@@ -657,6 +655,21 @@ type DownloadQuickOptionProps = OptionProps & {
collectionSummary: CollectionSummary;
};
+const DownloadIcon: React.FC = () => (
+ <svg
+ width="18"
+ height="18"
+ viewBox="0 0 16 16"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M14 11V14H2V11H0V14C0 15.1 0.9 16 2 16H14C15.1 16 16 15.1 16 14V11H14ZM13 7L11.59 5.59L9 8.17V0H7V8.17L4.41 5.59L3 7L8 12L13 7Z"
+ fill="currentColor"
+ />
+ </svg>
+);
+
const DownloadQuickOption: React.FC<DownloadQuickOptionProps> = ({
collectionSummary: { type },
onClick,
@@ -673,34 +686,53 @@ const DownloadQuickOption: React.FC<DownloadQuickOptionProps> = ({
}
>
<IconButton onClick={onClick}>
- <FileDownloadOutlinedIcon />
+ <Box
+ sx={{
+ width: 24,
+ height: 24,
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ }}
+ >
+ <DownloadIcon />
+ </Box>
</IconButton>
</Tooltip>
);
-const showNotificationsQuickOption = ({ type }: CollectionSummary) =>
+const showFeedQuickOption = ({ type }: CollectionSummary) =>
type == "album" || type == "folder";
-const NotificationsIcon: React.FC = () => (
+const FeedIcon: React.FC = () => (
<svg
- width="18"
- height="19"
- viewBox="0 0 20 21"
+ width="23"
+ height="20"
+ viewBox="0 0 23 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
- d="M13.5 16.5C13.5 18.433 11.933 20 10 20C8.067 20 6.5 18.433 6.5 16.5M17.2311 16.5H2.76887C1.79195 16.5 1 15.708 1 14.7311C1 14.262 1.18636 13.8121 1.51809 13.4803L2.12132 12.8771C2.68393 12.3145 3 11.5514 3 10.7558V8C3 4.13401 6.13401 1 10 1C13.866 1 17 4.134 17 8V10.7558C17 11.5514 17.3161 12.3145 17.8787 12.8771L18.4819 13.4803C18.8136 13.8121 19 14.262 19 14.7311C19 15.708 18.208 16.5 17.2311 16.5Z"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
+ d="M9.7998 0.5C10.2416 0.5 10.5996 0.857977 10.5996 1.2998C10.5996 1.74163 10.2416 2.09961 9.7998 2.09961H4.7998C3.03249 2.09961 1.59961 3.53249 1.59961 5.2998V14.2998C1.59961 16.0671 3.0325 17.5 4.7998 17.5H13.7998C15.5671 17.5 17 16.0671 17 14.2998V11.7998C17 11.358 17.358 11 17.7998 11C18.2416 11 18.5996 11.358 18.5996 11.7998V14.2998C18.5996 16.9507 16.4507 19.0996 13.7998 19.0996H4.7998C2.14883 19.0996 0 16.9507 0 14.2998V5.2998C0 2.64884 2.14884 0.5 4.7998 0.5H9.7998Z"
+ fill="currentColor"
+ />
+ <path
+ d="M13.2998 13.5C13.7416 13.5 14.0996 13.858 14.0996 14.2998C14.0996 14.7416 13.7416 15.0996 13.2998 15.0996H4.2998C3.85798 15.0996 3.5 14.7416 3.5 14.2998C3.5 13.858 3.85798 13.5 4.2998 13.5H13.2998Z"
+ fill="currentColor"
+ />
+ <path
+ d="M10.2998 10.5C10.7416 10.5 11.0996 10.858 11.0996 11.2998C11.0996 11.7416 10.7416 12.0996 10.2998 12.0996H4.2998C3.85798 12.0996 3.5 11.7416 3.5 11.2998C3.5 10.858 3.85798 10.5 4.2998 10.5H10.2998Z"
+ fill="currentColor"
+ />
+ <path
+ d="M20.6523 6.12012C21.3761 5.2635 22.0996 4.13144 22.0996 2.93848C22.0995 1.38141 20.9626 0 19.2998 0C18.621 0 17.9847 0.205224 17.2998 0.749023C16.6149 0.205224 15.9787 0 15.2998 0C13.637 0 12.5001 1.38141 12.5 2.93848C12.5 4.13144 13.2236 5.2635 13.9473 6.12012C14.698 7.00866 15.5878 7.76218 16.1758 8.21484C16.8431 8.72865 17.7565 8.72865 18.4238 8.21484C19.0119 7.76218 19.9016 7.00866 20.6523 6.12012Z"
+ fill="currentColor"
/>
</svg>
);
-const NotificationsQuickOption: React.FC<OptionProps> = ({ onClick }) => (
- <Tooltip title={t("notifications")}>
+const FeedQuickOption: React.FC<OptionProps> = ({ onClick }) => (
+ <Tooltip title={t("feed")}>
<IconButton onClick={onClick}>
<Box
sx={{
@@ -711,7 +743,7 @@ const NotificationsQuickOption: React.FC<OptionProps> = ({ onClick }) => (
justifyContent: "center",
}}
>
- <NotificationsIcon />
+ <FeedIcon />
</Box>
</IconButton>
</Tooltip>
@@ -728,6 +760,21 @@ interface ShareQuickOptionProps {
onClick: () => void;
}
+const ShareIcon: React.FC = () => (
+ <svg
+ width="21"
+ height="19"
+ viewBox="0 0 22 20"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M13.875 8C13.3918 8 13 8.39175 13 8.875C13 9.35825 13.3918 9.75 13.875 9.75V8.875V8ZM13.875 0C13.3918 0 13 0.391751 13 0.875C13 1.35825 13.3918 1.75 13.875 1.75V0.875V0ZM15.875 11C15.3918 11 15 11.3918 15 11.875C15 12.3582 15.3918 12.75 15.875 12.75V11.875V11ZM17.375 18C16.8918 18 16.5 18.3918 16.5 18.875C16.5 19.3582 16.8918 19.75 17.375 19.75V18.875V18ZM11.875 4.875H11C11 6.60089 9.60086 8 7.875 8V8.875V9.75C10.5673 9.75 12.75 7.56739 12.75 4.875H11.875ZM7.875 8.875V8C6.14911 8 4.75 6.60089 4.75 4.875H3.875H3C3 7.56739 5.18261 9.75 7.875 9.75V8.875ZM3.875 4.875H4.75C4.75 3.14911 6.14911 1.75 7.875 1.75V0.875V0C5.18261 0 3 2.18261 3 4.875H3.875ZM7.875 0.875V1.75C9.60086 1.75 11 3.14911 11 4.875H11.875H12.75C12.75 2.18261 10.5673 0 7.875 0V0.875ZM13.875 8.875V9.75C16.5673 9.75 18.75 7.56739 18.75 4.875H17.875H17C17 6.60089 15.6009 8 13.875 8V8.875ZM17.875 4.875H18.75C18.75 2.18261 16.5673 0 13.875 0V0.875V1.75C15.6009 1.75 17 3.14911 17 4.875H17.875ZM9.875 11.875V11H5.875V11.875V12.75H9.875V11.875ZM5.875 11.875V11C2.63033 11 0 13.6304 0 16.875H0.875H1.75C1.75 14.5968 3.59683 12.75 5.875 12.75V11.875ZM0.875 16.875H0C0 18.4629 1.28719 19.75 2.875 19.75V18.875V18C2.25367 18 1.75 17.4963 1.75 16.875H0.875ZM2.875 18.875V19.75H12.875V18.875V18H2.875V18.875ZM12.875 18.875V19.75C14.4628 19.75 15.75 18.4628 15.75 16.875H14.875H14C14 17.4964 13.4964 18 12.875 18V18.875ZM14.875 16.875H15.75C15.75 13.6304 13.1196 11 9.875 11V11.875V12.75C12.1532 12.75 14 14.5968 14 16.875H14.875ZM15.875 11.875V12.75C18.1532 12.75 20 14.5968 20 16.875H20.875H21.75C21.75 13.6304 19.1196 11 15.875 11V11.875ZM20.875 16.875H20C20 17.4964 19.4964 18 18.875 18V18.875V19.75C20.4628 19.75 21.75 18.4628 21.75 16.875H20.875ZM18.875 18.875V18H17.375V18.875V19.75H18.875V18.875Z"
+ fill="currentColor"
+ />
+ </svg>
+);
+
const ShareQuickOption: React.FC<ShareQuickOptionProps> = ({
collectionSummary: { attributes },
onClick,
@@ -744,7 +791,17 @@ const ShareQuickOption: React.FC<ShareQuickOptionProps> = ({
}
>
<IconButton onClick={onClick}>
- <PeopleIcon />
+ <Box
+ sx={{
+ width: 24,
+ height: 24,
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ }}
+ >
+ <ShareIcon />
+ </Box>
</IconButton>
</Tooltip>
);
@@ -771,7 +828,7 @@ const DownloadOption: React.FC<
isDownloadInProgress?.() ? (
<ActivityIndicator size="20px" sx={{ cursor: "not-allowed" }} />
) : (
- <FileDownloadOutlinedIcon />
+ <DownloadIcon />
)
}
onClick={onClick}
diff --git a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
index 7f6465b3a3..a162f2fe96 100644
--- a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
@@ -11,7 +11,7 @@ import {
isSaveComplete,
type SaveGroup,
} from "ente-gallery/components/utils/save-groups";
-import { NotificationsSidebar } from "ente-gallery/components/viewer/NotificationsSidebar";
+import { FeedSidebar } from "ente-gallery/components/viewer/FeedSidebar";
import { sortFiles } from "ente-gallery/utils/file";
import type { Collection } from "ente-media/collection";
import type { EnteFile } from "ente-media/file";
@@ -106,8 +106,8 @@ export const GalleryBarAndListHeader: React.FC<
const { show: showCollectionCast, props: collectionCastVisibilityProps } =
useModalVisibility();
const {
- show: showCollectionNotifications,
- props: collectionNotificationsVisibilityProps,
+ show: showCollectionFeed,
+ props: collectionFeedVisibilityProps,
} = useModalVisibility();
const [collectionsSortBy, setCollectionsSortBy] =
@@ -156,7 +156,7 @@ export const GalleryBarAndListHeader: React.FC<
}
onCollectionShare={showCollectionShare}
onCollectionCast={showCollectionCast}
- onCollectionNotifications={showCollectionNotifications}
+ onCollectionFeed={showCollectionFeed}
/>
) : activePerson ? (
<PeopleHeader
@@ -178,7 +178,7 @@ export const GalleryBarAndListHeader: React.FC<
activePerson,
showCollectionShare,
showCollectionCast,
- showCollectionNotifications,
+ showCollectionFeed,
// TODO: Cluster
// This causes a loop since it is an array dep
// people,
@@ -237,8 +237,8 @@ export const GalleryBarAndListHeader: React.FC<
{...collectionCastVisibilityProps}
collection={activeCollection}
/>
- <NotificationsSidebar
- {...collectionNotificationsVisibilityProps}
+ <FeedSidebar
+ {...collectionFeedVisibilityProps}
albumName={activeCollection?.name ?? ""}
/>
</>
diff --git a/web/packages/base/locales/en-US/translation.json b/web/packages/base/locales/en-US/translation.json
index be31e9e5ce..842168fed9 100644
--- a/web/packages/base/locales/en-US/translation.json
+++ b/web/packages/base/locales/en-US/translation.json
@@ -243,7 +243,7 @@
"delete_photos": "Delete photos",
"keep_photos": "Keep photos",
"share_album": "Share album",
- "notifications": "Notifications",
+ "feed": "Feed",
"sharing_with_self": "You cannot share with yourself",
"sharing_already_shared": "You're already sharing this with {{email}}",
"sharing_album_not_allowed": "Sharing album not allowed",
diff --git a/web/packages/gallery/components/viewer/NotificationsSidebar.tsx b/web/packages/gallery/components/viewer/FeedSidebar.tsx
similarity index 95%
rename from web/packages/gallery/components/viewer/NotificationsSidebar.tsx
rename to web/packages/gallery/components/viewer/FeedSidebar.tsx
index c3cbeb8fd5..63dcaac7c4 100644
--- a/web/packages/gallery/components/viewer/NotificationsSidebar.tsx
+++ b/web/packages/gallery/components/viewer/FeedSidebar.tsx
@@ -7,7 +7,7 @@ import React from "react";
// Types
// =============================================================================
-export interface NotificationsSidebarProps extends ModalVisibilityProps {
+export interface FeedSidebarProps extends ModalVisibilityProps {
/**
* The name of the album to display in the header.
*/
@@ -19,9 +19,9 @@ export interface NotificationsSidebarProps extends ModalVisibilityProps {
// =============================================================================
/**
- * A sidebar panel for displaying notifications for an album.
+ * A sidebar panel for displaying the feed for an album.
*/
-export const NotificationsSidebar: React.FC<NotificationsSidebarProps> = ({
+export const FeedSidebar: React.FC<FeedSidebarProps> = ({
open,
onClose,
albumName,