From 0681607067fa432702f13af30795583eaccbf385 Mon Sep 17 00:00:00 2001 From: Shivank Kacker Date: Thu, 17 Oct 2024 15:13:13 +0530 Subject: [PATCH] Updated Variable Names --- src/Components/Common/Avatar.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Components/Common/Avatar.tsx b/src/Components/Common/Avatar.tsx index c8fdc9ca44e..e4d42dd72ae 100644 --- a/src/Components/Common/Avatar.tsx +++ b/src/Components/Common/Avatar.tsx @@ -56,18 +56,18 @@ const Avatar: React.FC = ({ className, }) => { const [bgColor] = propColors || toColor(name); - const [w, setW] = useState(0); + const [width, setWidth] = useState(0); const avatarRef = useRef(null); useEffect(() => { - const updateW = () => { + const updateWidth = () => { const avatarRect = avatarRef.current?.getBoundingClientRect(); - const w = avatarRect?.width || 0; - setW(w); + const width = avatarRect?.width || 0; + setWidth(width); }; - updateW(); - document.addEventListener("resize", updateW); - return () => document.removeEventListener("resize", updateW); + updateWidth(); + document.addEventListener("resize", updateWidth); + return () => document.removeEventListener("resize", updateWidth); }, []); return ( @@ -79,8 +79,8 @@ const Avatar: React.FC = ({ )} style={{ background: bgColor, - borderRadius: w / 15 + "px", - fontSize: w / 2.5 + "px", + borderRadius: width / 15 + "px", + fontSize: width / 2.5 + "px", }} > {imageUrl ? (