π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
refactor(photos):replace-custom-icons-and-colocate-assets
Aswin Asok90ae924874ef
diff --git a/web/apps/photos/src/components/Collections/AllAlbums.tsx b/web/apps/photos/src/components/Collections/AllAlbums.tsxindex 50af33191c..0a9d7abad6 100644--- a/web/apps/photos/src/components/Collections/AllAlbums.tsx+++ b/web/apps/photos/src/components/Collections/AllAlbums.tsx@@ -21,8 +21,7 @@ import {} from "@/components/CollectionDialog/styles";import { CollectionsSortOptions } from "@/components/CollectionsSortOptions";import type { RemotePullOpts } from "@/components/gallery";-import { StarIcon } from "@/components/icons/StarIcon";-import { Delete02Icon } from "@hugeicons/core-free-icons";+import { Delete02Icon, StarIcon } from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import ArchiveIcon from "@mui/icons-material/Archive";import ArrowForwardIcon from "@mui/icons-material/ArrowForward";@@ -823,7 +822,13 @@ const AlbumCard: React.FC<AlbumCardProps> = ({}}>{isFavorite && (- <StarIcon sx={{ fontSize: 20, color: "white" }} />+ <HugeiconsIcon+ icon={StarIcon}+ size={20}+ color="white"+ fill="currentColor"+ aria-hidden+ />)}{isPinned && (<PushPinIcon sx={{ fontSize: 20, color: "white" }} />diff --git a/web/apps/photos/src/components/Collections/CollectionHeader.tsx b/web/apps/photos/src/components/Collections/CollectionHeader.tsxindex c612b6290a..6fc0af57b1 100644--- a/web/apps/photos/src/components/Collections/CollectionHeader.tsx+++ b/web/apps/photos/src/components/Collections/CollectionHeader.tsx@@ -1,11 +1,11 @@import type { RemotePullOpts } from "@/components/gallery";-import { StarIcon } from "@/components/icons/StarIcon";import { downloadAndSaveCollectionFiles } from "@/services/save";import {CleanIcon,Delete02Icon,ModernTvIcon,RemoveCircleIcon,+ StarIcon,} from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import ArchiveOutlinedIcon from "@mui/icons-material/ArchiveOutlined";@@ -109,7 +109,14 @@ export const CollectionHeader: React.FC<CollectionHeaderProps> = (props) => {</Box>);if (attributes.has("userFavorites"))- return <StarIcon fontSize="small" />;+ return (+ <HugeiconsIcon+ icon={StarIcon}+ size="1em"+ fill="currentColor"+ aria-hidden+ />+ );return <></>;};diff --git a/web/apps/photos/src/components/FileContextMenu.tsx b/web/apps/photos/src/components/FileContextMenu.tsxindex 556c9c84c2..a81271cdab 100644--- a/web/apps/photos/src/components/FileContextMenu.tsx+++ b/web/apps/photos/src/components/FileContextMenu.tsx@@ -1,4 +1,3 @@-import { StarBorderIcon } from "@/components/icons/StarIcon";import type { FileContextAction } from "@/utils/file-actions";import {AddSquareIcon,@@ -10,6 +9,7 @@ import {Location01Icon,Navigation03Icon,RemoveCircleIcon,+ StarIcon,StarOffIcon,Time04Icon,Unarchive03Icon,@@ -56,7 +56,7 @@ const actionConfigs: Record<FileContextAction, ActionConfig> = {download: { label: "download", Icon: hugeIcon(Download01Icon) },fixTime: { label: "fix_creation_time", Icon: hugeIcon(Time04Icon) },editLocation: { label: "edit_location", Icon: hugeIcon(Location01Icon) },- favorite: { label: "favorite", Icon: <StarBorderIcon fontSize="small" /> },+ favorite: { label: "favorite", Icon: hugeIcon(StarIcon) },unfavorite: { label: "un_favorite", Icon: hugeIcon(StarOffIcon) },archive: { label: "archive", Icon: hugeIcon(Download05Icon) },unarchive: { label: "unarchive", Icon: hugeIcon(Unarchive03Icon) },diff --git a/web/apps/photos/src/components/FileList.tsx b/web/apps/photos/src/components/FileList.tsxindex 6c037de2a3..a517951b88 100644--- a/web/apps/photos/src/components/FileList.tsx+++ b/web/apps/photos/src/components/FileList.tsx@@ -4,7 +4,6 @@ import {type ContextMenuPosition,} from "@/components/FileContextMenu";import type { GalleryBarMode } from "@/components/gallery/reducer";-import { StarIcon } from "@/components/icons/StarIcon";import {selectedFavoriteCount as countSelectedFavorites,type SelectedState,@@ -17,6 +16,8 @@ import {handleSelectCreator,handleSelectCreatorMulti,} from "@/utils/photoFrame";+import { StarIcon } from "@hugeicons/core-free-icons";+import { HugeiconsIcon } from "@hugeicons/react";import AlbumOutlinedIcon from "@mui/icons-material/AlbumOutlined";import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";import PlayArrowRoundedIcon from "@mui/icons-material/PlayArrowRounded";@@ -1114,7 +1115,12 @@ const FileThumbnail: React.FC<FileThumbnailProps> = ({)}{isFav && (<FavoriteOverlay>- <StarIcon fontSize="small" />+ <HugeiconsIcon+ icon={StarIcon}+ size={20}+ fill="currentColor"+ aria-hidden+ /></FavoriteOverlay>)}diff --git a/web/apps/photos/src/components/SelectedFileOptions.tsx b/web/apps/photos/src/components/SelectedFileOptions.tsxindex 93d4279e85..f93b079eb1 100644--- a/web/apps/photos/src/components/SelectedFileOptions.tsx+++ b/web/apps/photos/src/components/SelectedFileOptions.tsx@@ -1,7 +1,5 @@import type { CollectionSelectorAttributes } from "@/components/CollectionSelector";import type { GalleryBarMode } from "@/components/gallery/reducer";-import { StarBorderIcon } from "@/components/icons/StarIcon";-import { StarOffIcon } from "@/components/icons/StarOffIcon";import {getAvailableFileActions,type FileContextAction,@@ -16,6 +14,8 @@ import {Location01Icon,Navigation03Icon,RemoveCircleIcon,+ StarIcon,+ StarOffIcon,Time04Icon,Unarchive03Icon,UserAdd02Icon,@@ -350,7 +350,7 @@ const SendLinkButton: React.FC<ButtonishProps> = ({ onClick }) => (const FavoriteButton: React.FC<ButtonishProps> = ({ onClick }) => (<Tooltip title={t("favorite")}><IconButton {...{ onClick }}>- <StarBorderIcon fontSize="small" />+ <HugeiconsIcon icon={StarIcon} size={20} aria-hidden /></IconButton></Tooltip>);@@ -358,7 +358,7 @@ const FavoriteButton: React.FC<ButtonishProps> = ({ onClick }) => (const UnfavoriteButton: React.FC<ButtonishProps> = ({ onClick }) => (<Tooltip title={t("un_favorite")}><IconButton {...{ onClick }}>- <StarOffIcon fontSize="small" />+ <HugeiconsIcon icon={StarOffIcon} size={20} aria-hidden /></IconButton></Tooltip>);diff --git a/web/apps/photos/src/components/app-lock/AppLockIllustrations.tsx b/web/apps/photos/src/components/app-lock/AppLockIllustrations.tsxindex ea0fb0c971..1e45ab3c85 100644--- a/web/apps/photos/src/components/app-lock/AppLockIllustrations.tsx+++ b/web/apps/photos/src/components/app-lock/AppLockIllustrations.tsx@@ -15,10 +15,7 @@ const illustrationSvgSx = (theme: Theme) => ({}),});-const LOCK_ILLUSTRATION_SRC = new URL(- "../icons/lock.svg",- import.meta.url,-).toString();+const LOCK_ILLUSTRATION_SRC = new URL("./lock.svg", import.meta.url).toString();export const LockIllustration = () => (<Boxdiff --git a/web/apps/photos/src/components/icons/lock.svg b/web/apps/photos/src/components/app-lock/lock.svgsimilarity index 100%rename from web/apps/photos/src/components/icons/lock.svgrename to web/apps/photos/src/components/app-lock/lock.svgdiff --git a/web/apps/photos/src/components/gallery/BarImpl.tsx b/web/apps/photos/src/components/gallery/BarImpl.tsxindex 0ddd1d2e2e..4f43778cff 100644--- a/web/apps/photos/src/components/gallery/BarImpl.tsx+++ b/web/apps/photos/src/components/gallery/BarImpl.tsx@@ -1,8 +1,7 @@import { CollectionsSortOptions } from "@/components/CollectionsSortOptions";-import { StarIcon } from "@/components/icons/StarIcon";import { PeopleSortOptions } from "@/components/PeopleSortOptions";import type { PeopleSortBy } from "@/utils/people-sort";-import { Link05Icon, PinIcon } from "@hugeicons/core-free-icons";+import { Link05Icon, PinIcon, StarIcon } from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import ArchiveIcon from "@mui/icons-material/Archive";import ExpandMoreIcon from "@mui/icons-material/ExpandMore";@@ -506,7 +505,14 @@ const CollectionBarCardIcon: React.FC<CollectionBarCardIconProps> = ({}) => (// A collection can show all four status icons at once.<CollectionBarCardIcon_>- {attributes.has("userFavorites") && <StarIcon fontSize="small" />}+ {attributes.has("userFavorites") && (+ <HugeiconsIcon+ icon={StarIcon}+ size={20}+ fill="currentColor"+ aria-hidden+ />+ )}{(attributes.has("pinned") || attributes.has("shareePinned")) && (<HugeiconsIcon icon={PinIcon} size={18} />)}diff --git a/web/apps/photos/src/components/icons/ShapeIcon.tsx b/web/apps/photos/src/components/icons/ShapeIcon.tsxdeleted file mode 100644index 9e5f1d2590..0000000000--- a/web/apps/photos/src/components/icons/ShapeIcon.tsx+++ /dev/null@@ -1,29 +0,0 @@-import SvgIcon, { type SvgIconProps } from "@mui/material/SvgIcon";-import React from "react";--export const ShapeIcon: React.FC<SvgIconProps> = (props) => (- <SvgIcon {...props} viewBox="0 0 24 24">- <path- d="M13.3382 10H10.6618C9.1273 10 8.36006 10 8.08543 9.49297C7.8108 8.98594 8.21743 8.32019 9.0307 6.9887L10.3689 4.79773C11.101 3.59924 11.467 3 12 3C12.533 3 12.899 3.59924 13.6311 4.79773L14.9693 6.9887C15.7826 8.32019 16.1892 8.98594 15.9146 9.49297C15.6399 10 14.8727 10 13.3382 10Z"- fill="none"- stroke="currentColor"- strokeWidth="1.5"- strokeLinejoin="round"- />- <circle- cx="17.5"- cy="17.5"- r="3.5"- fill="none"- stroke="currentColor"- strokeWidth="1.5"- />- <path- d="M9.66294 20.1111C10 19.6067 10 18.9045 10 17.5C10 16.0955 10 15.3933 9.66294 14.8889C9.51702 14.6705 9.32952 14.483 9.11114 14.3371C8.60669 14 7.90446 14 6.5 14C5.09554 14 4.39331 14 3.88886 14.3371C3.67048 14.483 3.48298 14.6705 3.33706 14.8889C3 15.3933 3 16.0955 3 17.5C3 18.9045 3 19.6067 3.33706 20.1111C3.48298 20.3295 3.67048 20.517 3.88886 20.6629C4.39331 21 5.09554 21 6.5 21C7.90446 21 8.60669 21 9.11114 20.6629C9.32952 20.517 9.51702 20.3295 9.66294 20.1111Z"- fill="none"- stroke="currentColor"- strokeWidth="1.5"- strokeLinejoin="round"- />- </SvgIcon>-);diff --git a/web/apps/photos/src/components/icons/StarIcon.tsx b/web/apps/photos/src/components/icons/StarIcon.tsxdeleted file mode 100644index 9f6799b2a7..0000000000--- a/web/apps/photos/src/components/icons/StarIcon.tsx+++ /dev/null@@ -1,21 +0,0 @@-import SvgIcon, { type SvgIconProps } from "@mui/material/SvgIcon";-import React from "react";--export const StarIcon: React.FC<SvgIconProps> = (props) => (- <SvgIcon {...props} viewBox="0 0 21 20">- <path d="M8.69381 1.56975C9.38617 0.609562 10.7995 0.609562 11.4919 1.56975L13.7114 4.64784C13.9253 4.9445 14.2255 5.16569 14.5699 5.28031L18.1427 6.46961C19.2572 6.84061 19.6939 8.20365 19.0073 9.16808L16.8062 12.2597C16.5941 12.5577 16.4794 12.9156 16.4783 13.2831L16.4669 17.0962C16.4634 18.2857 15.32 19.1281 14.2033 18.764L10.6234 17.5966C10.2784 17.4841 9.90729 17.4841 9.56228 17.5966L5.98245 18.764C4.86575 19.1281 3.72231 18.2857 3.71876 17.0962L3.70737 13.2831C3.70628 12.9156 3.5916 12.5577 3.37946 12.2597L1.17839 9.16808C0.491785 8.20365 0.928537 6.84061 2.04305 6.46961L5.61584 5.28031C5.96017 5.16569 6.26041 4.9445 6.47432 4.64784L8.69381 1.56975Z" />- </SvgIcon>-);--export const StarBorderIcon: React.FC<SvgIconProps> = (props) => (- <SvgIcon {...props} viewBox="0 0 21 20">- <path- d="M8.69381 1.56975C9.38617 0.609562 10.7995 0.609562 11.4919 1.56975L13.7114 4.64784C13.9253 4.9445 14.2255 5.16569 14.5699 5.28031L18.1427 6.46961C19.2572 6.84061 19.6939 8.20365 19.0073 9.16808L16.8062 12.2597C16.5941 12.5577 16.4794 12.9156 16.4783 13.2831L16.4669 17.0962C16.4634 18.2857 15.32 19.1281 14.2033 18.764L10.6234 17.5966C10.2784 17.4841 9.90729 17.4841 9.56228 17.5966L5.98245 18.764C4.86575 19.1281 3.72231 18.2857 3.71876 17.0962L3.70737 13.2831C3.70628 12.9156 3.5916 12.5577 3.37946 12.2597L1.17839 9.16808C0.491785 8.20365 0.928537 6.84061 2.04305 6.46961L5.61584 5.28031C5.96017 5.16569 6.26041 4.9445 6.47432 4.64784L8.69381 1.56975Z"- fill="none"- stroke="currentColor"- strokeWidth="1.7"- strokeLinecap="round"- strokeLinejoin="round"- />- </SvgIcon>-);diff --git a/web/apps/photos/src/components/icons/StarOffIcon.tsx b/web/apps/photos/src/components/icons/StarOffIcon.tsxdeleted file mode 100644index 72003e2a89..0000000000--- a/web/apps/photos/src/components/icons/StarOffIcon.tsx+++ /dev/null@@ -1,22 +0,0 @@-import SvgIcon, { type SvgIconProps } from "@mui/material/SvgIcon";-import React from "react";--export const StarOffIcon: React.FC<SvgIconProps> = (props) => (- <SvgIcon {...props} viewBox="0 0 21 20">- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 24 24"- width="24"- height="24"- fill="none"- stroke="currentColor"- strokeWidth="1.5"- strokeLinecap="round"- strokeLinejoin="round"- >- <path d="M18.5038 14.5L21.1477 11.8925C22.616 10.4206 22.1366 8.92853 20.099 8.58575L16.9128 8.05143C16.3734 7.9607 15.7342 7.48687 15.4945 6.99288L13.7366 3.44418C12.7877 1.51861 11.2296 1.51861 10.2707 3.44418L9.5 5" />- <path d="M7.29561 7.99998C7.22668 8.02267 7.15848 8.04006 7.09201 8.05144L3.90008 8.58576C1.85885 8.92853 1.38856 10.4206 2.84945 11.8925L5.33095 14.3927C5.7512 14.8161 5.98134 15.6327 5.85126 16.2175L5.14083 19.3125C4.58049 21.7522 5.88128 22.7099 8.02257 21.4296L11.0144 19.6452C11.5647 19.3226 12.4553 19.3226 12.9956 19.6452L15.9874 21.4296C18.1387 22.7099 19.4295 21.7623 18.8691 19.3125L18.7974 19" />- <path d="M2 2L22 22" />- </svg>- </SvgIcon>-);diff --git a/web/apps/photos/src/components/EnteAppIcon.tsx b/web/apps/photos/src/components/sidebar/EnteAppIcon.tsxsimilarity index 100%rename from web/apps/photos/src/components/EnteAppIcon.tsxrename to web/apps/photos/src/components/sidebar/EnteAppIcon.tsxdiff --git a/web/apps/photos/src/components/sidebar/Sidebar.tsx b/web/apps/photos/src/components/sidebar/Sidebar.tsxindex 06b76c642e..f805507c83 100644--- a/web/apps/photos/src/components/sidebar/Sidebar.tsx+++ b/web/apps/photos/src/components/sidebar/Sidebar.tsx@@ -1,4 +1,3 @@-import { ShapeIcon } from "@/components/icons/ShapeIcon";import { downloadAppDialogAttributes } from "@/components/utils/download";import exportService from "@/services/export";import {@@ -9,6 +8,7 @@ import { performSidebarAction as performSidebarRegistryAction } from "@/servicesimport {Delete02Icon,Download05Icon,+ GeometricShapes01Icon,ViewOffSlashIcon,} from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";@@ -702,7 +702,13 @@ const ShortcutSection: React.FC<ShortcutSectionProps> = ({return (<><RowButton- startIcon={<ShapeIcon />}+ startIcon={+ <HugeiconsIcon+ icon={GeometricShapes01Icon}+ size={shortcutIconSize}+ aria-hidden+ />+ }label={t("section_uncategorized")}caption={summaryCaption(uncategorizedCollectionSummaryID)}onClick={handleOpenUncategorizedSection}diff --git a/web/apps/photos/src/components/sidebar/account/DeleteAccount.tsx b/web/apps/photos/src/components/sidebar/account/DeleteAccount.tsxindex b6b58a5653..5bfe2f8fff 100644--- a/web/apps/photos/src/components/sidebar/account/DeleteAccount.tsx+++ b/web/apps/photos/src/components/sidebar/account/DeleteAccount.tsx@@ -1,8 +1,3 @@-import {- EnteAuthIcon,- EnteLockerIcon,- EntePhotosIcon,-} from "@/components/EnteAppIcon";import ArrowBackIcon from "@mui/icons-material/ArrowBack";import ErrorOutlinedIcon from "@mui/icons-material/ErrorOutlined";import {@@ -45,6 +40,7 @@ import { t } from "i18next";import React, { useState } from "react";import { Trans } from "react-i18next";import { DropdownInput, type DropdownOption } from "../DropdownInput";+import { EnteAuthIcon, EnteLockerIcon, EntePhotosIcon } from "../EnteAppIcon";type DeleteAccountProps = ModalVisibilityProps & {onAuthenticateUser: () => Promise<boolean>;