Skip to content

Commit

Permalink
review: make customisable maxPlayers + increase animation
Browse files Browse the repository at this point in the history
  • Loading branch information
caxewsh committed Oct 19, 2024
1 parent 7cf0f7f commit f6f233d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions components/lobbyscreen/PlayerCount.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -14,7 +13,7 @@ const PlayerCount = ({ players }) => {
});

useEffect(() => {
animatedScale.value = withSpring(1.2, {}, () => {
animatedScale.value = withSpring(1.3, {}, () => {
animatedScale.value = withSpring(1);
});
}, [players.length]);
Expand Down

0 comments on commit f6f233d

Please sign in to comment.