diff --git a/src/components/user-card/user-card.tsx b/src/components/user-card/user-card.tsx index cdda9af..25ed2e2 100644 --- a/src/components/user-card/user-card.tsx +++ b/src/components/user-card/user-card.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useMemo } from 'react' import { sha256 } from 'js-sha256' import { useState, useEffect, useRef } from 'react' import { Box, useColorMode, Text } from '@chakra-ui/react' @@ -19,7 +19,7 @@ const REACTION_EMOJIS = { clap: 'πŸ‘' } -export function getGravatarURL(email, user) { +export function getGravatarURL(email) { if (!email) return void 0 const address = String(email).trim().toLowerCase() const hash = sha256(address) @@ -49,6 +49,8 @@ export const UserCard = ({ const [imageError, setImageError] = useState(false); const [showReaction, setShowReaction] = useState(false); const timeoutRef = useRef(null); + + const randomGravatarPath = useMemo(() => Math.random() * 1000, []) // ΠžΠ±Ρ€Π°Π±Π°Ρ‚Ρ‹Π²Π°Π΅ΠΌ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ Ρ€Π΅Π°ΠΊΡ†ΠΈΠΈ useEffect(() => { @@ -83,7 +85,7 @@ export const UserCard = ({ position="relative" > { if (!imageError && student.picture) { setImageError(true);