From 1330bf6f9e5772019bed68764c477c364047ed02 Mon Sep 17 00:00:00 2001 From: Luca Doglione Date: Fri, 9 Feb 2024 11:24:07 +0100 Subject: [PATCH] Adding postpone button --- src/components/Stage/index.tsx | 9 ++++++++- src/components/StandupTimer/index.tsx | 27 ++++++++++++++++++++------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/components/Stage/index.tsx b/src/components/Stage/index.tsx index 6eea816..53f41a9 100644 --- a/src/components/Stage/index.tsx +++ b/src/components/Stage/index.tsx @@ -8,9 +8,10 @@ type StageProps = { index: number; onCompleted: () => void; onNext: () => void; + onPostpone: () => void; }; -export default function Stage({ member, onCompleted, onNext, index }: StageProps) { +export default function Stage({ member, onCompleted, onNext, index, onPostpone }: StageProps) { const [currentTime, setCurrentTime] = useState(0); useEffect(() => { @@ -48,6 +49,12 @@ export default function Stage({ member, onCompleted, onNext, index }: StageProps >
+

+ POSTPONE +

{ + if (currentMember < members.length - 1) { + members.push(members[currentMember]); + setCurrentMember(currentMember + 1); + } + }; + return (
{!completed && ( <> - + {currentMember < members.length - 1 && ( <>
-
-
+
+
-

Next One

+

Next One

{members[currentMember + 1].name}

-

{members[currentMember + 1].role}

+

{members[currentMember + 1].role}

)} @@ -43,8 +56,8 @@ export default function StandupTimer({ members }: StandupTimerProps) { )} {completed && ( -

Standup completed 🚀

-

See you tomorrow 👋🏼

+

Standup completed 🚀

+

See you tomorrow 👋🏼

)}