diff --git a/frontend/package.json b/frontend/package.json index 8a60c11095..524f90fa6c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,7 +11,6 @@ "preview": "vite preview" }, "dependencies": { - "@metamask/jazzicon": "^2.0.0", "@microsoft/fetch-event-source": "^2.0.1", "@mintplex-labs/piper-tts-web": "^1.0.4", "@phosphor-icons/react": "^2.1.7", @@ -71,4 +70,4 @@ "tailwindcss": "^3.3.1", "vite": "^4.3.0" } -} +} \ No newline at end of file diff --git a/frontend/src/components/UserIcon/index.jsx b/frontend/src/components/UserIcon/index.jsx index 7fc6b8df6d..037a2aff08 100644 --- a/frontend/src/components/UserIcon/index.jsx +++ b/frontend/src/components/UserIcon/index.jsx @@ -1,35 +1,42 @@ -import React, { useRef, useEffect } from "react"; -import JAZZ from "@metamask/jazzicon"; +import React, { memo } from "react"; import usePfp from "../../hooks/usePfp"; +import UserDefaultPfp from "./user.svg"; +import WorkspaceDefaultPfp from "./workspace.svg"; -export default function UserIcon({ size = 36, user, role }) { +const UserIcon = memo(({ role }) => { const { pfp } = usePfp(); - const divRef = useRef(null); - const seed = user?.uid - ? toPseudoRandomInteger(user.uid) - : Math.floor(100000 + Math.random() * 900000); - - useEffect(() => { - if (!divRef.current || (role === "user" && pfp)) return; - - const result = JAZZ(size, seed); - divRef.current.appendChild(result); - }, [pfp, role, seed, size]); return (
-
- {role === "user" && pfp && ( + {role === "user" && } + {role !== "user" && ( User profile picture )}
); -} +}); + +function RenderUserPfp({ pfp }) { + if (!pfp) + return ( + User profile picture + ); -function toPseudoRandomInteger(uidString = "") { - return uidString.split("").reduce((acc, char) => acc + char.charCodeAt(0), 0); + return ( + User profile picture + ); } + +export default UserIcon; diff --git a/frontend/src/components/UserIcon/user.svg b/frontend/src/components/UserIcon/user.svg new file mode 100644 index 0000000000..b0812cd2b4 --- /dev/null +++ b/frontend/src/components/UserIcon/user.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/frontend/src/components/UserIcon/workspace.png b/frontend/src/components/UserIcon/workspace.png deleted file mode 100644 index 537d583c58..0000000000 Binary files a/frontend/src/components/UserIcon/workspace.png and /dev/null differ diff --git a/frontend/src/components/UserIcon/workspace.svg b/frontend/src/components/UserIcon/workspace.svg new file mode 100644 index 0000000000..6a24de58bd --- /dev/null +++ b/frontend/src/components/UserIcon/workspace.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 4a56e4f92c..475910ac4d 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -483,14 +483,6 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@metamask/jazzicon@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@metamask/jazzicon/-/jazzicon-2.0.0.tgz#5615528e91c0fc5c9d79202d1f0954a7922525a0" - integrity sha512-7M+WSZWKcQAo0LEhErKf1z+D3YX0tEDAcGvcKbDyvDg34uvgeKR00mFNIYwAhdAS9t8YXxhxZgsrRBBg6X8UQg== - dependencies: - color "^0.11.3" - mersenne-twister "^1.1.0" - "@microsoft/fetch-event-source@^2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@microsoft/fetch-event-source/-/fetch-event-source-2.0.1.tgz#9ceecc94b49fbaa15666e38ae8587f64acce007d" @@ -1097,11 +1089,6 @@ cliui@^8.0.1: strip-ansi "^6.0.1" wrap-ansi "^7.0.0" -clone@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== - clsx@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" @@ -1112,7 +1099,7 @@ clsx@^2.0.0: resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.1.1.tgz#eed397c9fd8bd882bfb18deab7102049a2f32999" integrity sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA== -color-convert@^1.3.0, color-convert@^1.9.0: +color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== @@ -1131,27 +1118,11 @@ color-name@1.1.3: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== -color-name@^1.0.0, color-name@~1.1.4: +color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-string@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-0.3.0.tgz#27d46fb67025c5c2fa25993bfbf579e47841b991" - integrity sha512-sz29j1bmSDfoAxKIEU6zwoIZXN6BrFbAMIhfYCNyiZXBDuU/aiHlN84lp/xDzL2ubyFhLDobHIlU1X70XRrMDA== - dependencies: - color-name "^1.0.0" - -color@^0.11.3: - version "0.11.4" - resolved "https://registry.yarnpkg.com/color/-/color-0.11.4.tgz#6d7b5c74fb65e841cd48792ad1ed5e07b904d764" - integrity sha512-Ajpjd8asqZ6EdxQeqGzU5WBhhTfJ/0cA4Wlbre7e5vXfmDSmda7Ov6jeKoru+b0vHcb1CqvuroTHp5zIWzhVMA== - dependencies: - clone "^1.0.2" - color-convert "^1.3.0" - color-string "^0.3.0" - commander@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" @@ -2545,11 +2516,6 @@ merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -mersenne-twister@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mersenne-twister/-/mersenne-twister-1.1.0.tgz#f916618ee43d7179efcf641bec4531eb9670978a" - integrity sha512-mUYWsMKNrm4lfygPkL3OfGzOPTR2DBlTkBNHM//F6hGp8cLThY897crAlk3/Jo17LEOOjQUrNAx6DvgO77QJkA== - micromatch@^4.0.4, micromatch@^4.0.5: version "4.0.7" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.7.tgz#33e8190d9fe474a9895525f5618eee136d46c2e5"