Skip to content

armgit / ente

Public Imported from GitHub
0

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

Replace deprecated Hugeicons package

Manav Rathieb7cb2b9dcaf
diff --git a/web/apps/share/package.json b/web/apps/share/package.json
index 36f5b8ecf0..b35c8ccf33 100644
--- a/web/apps/share/package.json
+++ b/web/apps/share/package.json
@@ -6,8 +6,9 @@
"build:post": "rm -f out/404.html"
},
"dependencies": {
- "ente-base": "*",
- "hugeicons-react": "0.3.0"
+ "@hugeicons/core-free-icons": "1.2.1",
+ "@hugeicons/react": "1.1.6",
+ "ente-base": "*"
},
"devDependencies": {
"ente-build-config": "*"
diff --git a/web/apps/share/src/components/file-share/CopyableField.tsx b/web/apps/share/src/components/file-share/CopyableField.tsx
index 4727cf24a8..0471e7dc83 100644
--- a/web/apps/share/src/components/file-share/CopyableField.tsx
+++ b/web/apps/share/src/components/file-share/CopyableField.tsx
@@ -1,6 +1,11 @@
+import {
+ Copy01Icon,
+ ViewIcon,
+ ViewOffSlashIcon,
+} from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
import CheckIcon from "@mui/icons-material/Check";
import { Box, IconButton, Typography } from "@mui/material";
-import { Copy01Icon, ViewIcon, ViewOffSlashIcon } from "hugeicons-react";
import React, { useState } from "react";
interface CopyableFieldProps {
@@ -87,9 +92,12 @@ export const CopyableField: React.FC<CopyableFieldProps> = ({
}}
>
{showValue ? (
- <ViewOffSlashIcon size={18} />
+ <HugeiconsIcon
+ icon={ViewOffSlashIcon}
+ size={18}
+ />
) : (
- <ViewIcon size={18} />
+ <HugeiconsIcon icon={ViewIcon} size={18} />
)}
</IconButton>
)}
@@ -113,7 +121,7 @@ export const CopyableField: React.FC<CopyableFieldProps> = ({
"&:hover": { bgcolor: "fill.faintHover" },
}}
>
- <Copy01Icon size={16} />
+ <HugeiconsIcon icon={Copy01Icon} size={16} />
</IconButton>
)}
</Box>
diff --git a/web/apps/share/src/utils/file-type.tsx b/web/apps/share/src/utils/file-type.tsx
index 0c4b31b105..133b31ebcb 100644
--- a/web/apps/share/src/utils/file-type.tsx
+++ b/web/apps/share/src/utils/file-type.tsx
@@ -6,7 +6,8 @@ import {
LockPasswordIcon,
NoteIcon,
VideoReplayIcon,
-} from "hugeicons-react";
+} from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
import React from "react";
export enum LockerInfoType {
@@ -118,25 +119,49 @@ export const getLockerFileIcon = (
switch (lockerType as LockerInfoType) {
case LockerInfoType.Note:
return {
- icon: <NoteIcon size={size} color="#FF9800" />,
+ icon: (
+ <HugeiconsIcon
+ icon={NoteIcon}
+ size={size}
+ color="#FF9800"
+ />
+ ),
backgroundColor: "#FF98000F",
};
case LockerInfoType.EmergencyContact:
return {
- icon: <ContactBookIcon size={size} color="#F44336" />,
+ icon: (
+ <HugeiconsIcon
+ icon={ContactBookIcon}
+ size={size}
+ color="#F44336"
+ />
+ ),
backgroundColor: "#F443360F",
};
case LockerInfoType.AccountCredential:
return {
- icon: <LockPasswordIcon size={size} color="#1071FF" />,
+ icon: (
+ <HugeiconsIcon
+ icon={LockPasswordIcon}
+ size={size}
+ color="#1071FF"
+ />
+ ),
backgroundColor: "#1071FF0F",
};
case LockerInfoType.PhysicalRecord:
return {
- icon: <Briefcase01Icon size={size} color="#9C27B0" />,
+ icon: (
+ <HugeiconsIcon
+ icon={Briefcase01Icon}
+ size={size}
+ color="#9C27B0"
+ />
+ ),
backgroundColor: "#9C27B00F",
};
}
@@ -147,28 +172,38 @@ export const getLockerFileIcon = (
if (isImageExtension(extension)) {
return {
- icon: <Image01Icon size={size} color="#08C225" />,
+ icon: (
+ <HugeiconsIcon icon={Image01Icon} size={size} color="#08C225" />
+ ),
backgroundColor: "#08C2250F",
};
}
if (isVideoExtension(extension)) {
return {
- icon: <VideoReplayIcon size={size} color="#8A38F5" />,
+ icon: (
+ <HugeiconsIcon
+ icon={VideoReplayIcon}
+ size={size}
+ color="#8A38F5"
+ />
+ ),
backgroundColor: "rgba(138, 56, 245, 0.06)",
};
}
if (isDocumentExtension(extension)) {
return {
- icon: <File02Icon size={size} color="#FF1A53" />,
+ icon: (
+ <HugeiconsIcon icon={File02Icon} size={size} color="#FF1A53" />
+ ),
backgroundColor: "rgba(255, 26, 83, 0.06)",
};
}
// Default: Generic file icon
return {
- icon: <File02Icon size={size} color="#757575" />,
+ icon: <HugeiconsIcon icon={File02Icon} size={size} color="#757575" />,
backgroundColor: "#FAFAFA",
};
};
diff --git a/web/package-lock.json b/web/package-lock.json
index c100d30a7a..2c2ee9419b 100644
--- a/web/package-lock.json
+++ b/web/package-lock.json
@@ -318,23 +318,14 @@
"apps/share": {
"version": "0.0.0",
"dependencies": {
- "ente-base": "*",
- "hugeicons-react": "0.3.0"
+ "@hugeicons/core-free-icons": "1.2.1",
+ "@hugeicons/react": "1.1.6",
+ "ente-base": "*"
},
"devDependencies": {
"ente-build-config": "*"
}
},
- "apps/share/node_modules/hugeicons-react": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/hugeicons-react/-/hugeicons-react-0.3.0.tgz",
- "integrity": "sha512-znmC+uX7xVqcIs0q09LvwEvJkjX0U3xgT05BSiRV19farS4lPONOKjYT0JkcQG5cvfV0rXHSEAEVNjbHAu81rg==",
- "deprecated": "Deprecated. Use @hugeicons/react: https://www.npmjs.com/package/@hugeicons/react",
- "license": "CC0-1.0",
- "peerDependencies": {
- "react": ">=16.0.0"
- }
- },
"apps/twoof3": {
"version": "0.0.0",
"dependencies": {