From deb3557ddccb0cd76d32fa3876fe5f9fabbd0106 Mon Sep 17 00:00:00 2001 From: SASHWAT12 <65287899+SASHWAT12@users.noreply.github.com> Date: Sun, 15 Dec 2024 18:51:56 +0530 Subject: [PATCH] Issue#1402 - Removed unused code as Suggested --- Client/src/Components/Avatar/index.jsx | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/Client/src/Components/Avatar/index.jsx b/Client/src/Components/Avatar/index.jsx index 6d27a2c2e..9173d870a 100644 --- a/Client/src/Components/Avatar/index.jsx +++ b/Client/src/Components/Avatar/index.jsx @@ -3,26 +3,6 @@ import PropTypes from "prop-types"; import { useSelector } from "react-redux"; import { useEffect, useState } from "react"; -/** - * Generates a color based on the input string. - * @param {string} string - The input string to generate the color from. - * @returns {string} - */ -const stringToColor = (string) => { - let hash = 0; - let i; - for (i = 0; i < string.length; i += 1) { - hash = string.charCodeAt(i) + ((hash << 5) - hash); - } - - let color = "#"; - for (i = 0; i < 3; i += 1) { - const value = (hash >> (i * 8)) & 0xff; - color += `00${value.toString(16)}`.slice(-2); - } - - return color; -}; /** * @component @@ -38,7 +18,6 @@ const stringToColor = (string) => { const Avatar = ({ src, small, sx }) => { const defaultAvatarColor = "#156EEF"; - const { user } = useSelector((state) => state.auth); const style = small ? { width: 32, height: 32 } : { width: 64, height: 64 };