From ae31cd027398f8de3d8e75b007c95d6f23754848 Mon Sep 17 00:00:00 2001 From: Ugo-X Date: Mon, 26 Aug 2024 02:47:58 +0100 Subject: [PATCH 1/2] updated the start component --- client/src/ui/actions/Start.tsx | 54 ++++++++++++++++++++++----------- client/src/ui/screens/Home.tsx | 15 +++++++-- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/client/src/ui/actions/Start.tsx b/client/src/ui/actions/Start.tsx index 449cc248..48020b97 100644 --- a/client/src/ui/actions/Start.tsx +++ b/client/src/ui/actions/Start.tsx @@ -10,9 +10,15 @@ import useAccountCustom from "@/hooks/useAccountCustom"; interface StartProps { mode: ModeType; + potentialWinnings: string; // New prop for potential winnings + remainingTime?: string; // New prop for remaining time (optional for Normal mode) } -export const Start: React.FC = ({ mode }) => { +export const Start: React.FC = ({ + mode, + potentialWinnings, + remainingTime, +}) => { const { master, setup: { @@ -64,27 +70,41 @@ export const Start: React.FC = ({ mode }) => { !account || !master || account === master || - !player || - (player?.daily_games_available === 0) || + !player || + player?.daily_games_available === 0 || (!!game && !game.isOver()) ); }, [account, master, player, game]); - const cost = useMemo(() =>{ - if(player && player?.daily_games_available >0) return "Free" - return "0.01 STRK" //TODO: replace with actual cost - }, [player, account]) - - // if (disabled) return null; + const cost = useMemo(() => { + if (player && player?.daily_games_available > 0) return "Free"; + return "0.01 STRK"; //TODO: replace with actual cost + }, [player, account]); return ( - +
+

+ {mode === ModeType.Daily ? "Daily Mode" : "Normal Mode"} +

+

+ Potential Winnings: {potentialWinnings} +

+

+ Price: {cost} +

+ {remainingTime && ( +

+ Remaining Time: {remainingTime} +

+ )} + +
); }; diff --git a/client/src/ui/screens/Home.tsx b/client/src/ui/screens/Home.tsx index 473b614a..2013f824 100644 --- a/client/src/ui/screens/Home.tsx +++ b/client/src/ui/screens/Home.tsx @@ -183,8 +183,19 @@ export const Home = () => {
- - + {/* + */} +
+ + +
{!game && (
From bf953458e321b4c4b265e9ffb97cee4d83fdcb79 Mon Sep 17 00:00:00 2001 From: Ugo-X Date: Mon, 26 Aug 2024 19:30:17 +0100 Subject: [PATCH 2/2] implemented requested changes on PR --- client/src/ui/screens/Home.tsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/client/src/ui/screens/Home.tsx b/client/src/ui/screens/Home.tsx index 2013f824..5f41dd60 100644 --- a/client/src/ui/screens/Home.tsx +++ b/client/src/ui/screens/Home.tsx @@ -186,15 +186,16 @@ export const Home = () => { {/* */}
- - + +
{!game && (