From f6f233d30b80d685471a6379e5d09759ba5fc52b Mon Sep 17 00:00:00 2001 From: caxewsh Date: Sat, 19 Oct 2024 20:00:36 +0200 Subject: [PATCH] review: make customisable maxPlayers + increase animation --- components/lobbyscreen/PlayerCount.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/lobbyscreen/PlayerCount.jsx b/components/lobbyscreen/PlayerCount.jsx index bbe7984..cdb52eb 100644 --- a/components/lobbyscreen/PlayerCount.jsx +++ b/components/lobbyscreen/PlayerCount.jsx @@ -3,8 +3,7 @@ import { View, Text } from "react-native"; import { UsersIcon } from "react-native-heroicons/solid"; import Animated, { useAnimatedStyle, useSharedValue, withSpring } from "react-native-reanimated"; -const PlayerCount = ({ players }) => { - const maxPlayers = 10; +const PlayerCount = ({ players, maxPlayers = 10 }) => { const animatedScale = useSharedValue(1); const animatedStyle = useAnimatedStyle(() => { @@ -14,7 +13,7 @@ const PlayerCount = ({ players }) => { }); useEffect(() => { - animatedScale.value = withSpring(1.2, {}, () => { + animatedScale.value = withSpring(1.3, {}, () => { animatedScale.value = withSpring(1); }); }, [players.length]);