From 543bf0dcc1ddf55c768b96d6873847e48ca8695a Mon Sep 17 00:00:00 2001 From: Justin Wyne <1986068+wyne@users.noreply.github.com> Date: Wed, 17 Apr 2024 21:20:11 -0700 Subject: [PATCH] Show a + plus icon on next round if it's the last one --- src/components/Headers/GameHeader.tsx | 30 +++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/components/Headers/GameHeader.tsx b/src/components/Headers/GameHeader.tsx index b3f960ca..2e75c79b 100644 --- a/src/components/Headers/GameHeader.tsx +++ b/src/components/Headers/GameHeader.tsx @@ -39,9 +39,10 @@ const PrevRoundButton: React.FunctionComponent = ({ prevRo interface NextRoundButtonProps { nextRoundHandler: () => void; visible: boolean; + showPlus?: boolean; } -const NextRoundButton: React.FunctionComponent = ({ nextRoundHandler, visible }) => { +const NextRoundButton: React.FunctionComponent = ({ nextRoundHandler, visible, showPlus = false }) => { return ( @@ -49,8 +50,21 @@ const NextRoundButton: React.FunctionComponent = ({ nextRo type="font-awesome-5" size={20} color={systemBlue} - style={{ opacity: visible ? 0 : 1 }} + style={{ opacity: visible ? 0 : 1, overflow: 'visible' }} /> + {showPlus && + + } ); }; @@ -84,7 +98,12 @@ const GameHeader: React.FunctionComponent = ({ navigation }) => { const nextRoundHandler = async () => { if (isLastRound && currentGame.locked) return; - Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium); + if (isLastRound) { + // Stronger haptics if creating a new round + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium); + } else { + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); + } dispatch(roundNext(currentGame.id)); analytics().logEvent('round_change', { @@ -116,7 +135,10 @@ const GameHeader: React.FunctionComponent = ({ navigation }) => { headerCenter={<> Round {roundCurrent + 1} - + } headerRight={!currentGame.locked && } />