From 83776bc651476570d286bb6ad3a2697a4a28e97a Mon Sep 17 00:00:00 2001 From: vutukuri15 Date: Sun, 9 Feb 2025 15:40:21 -0800 Subject: [PATCH 1/2] Created a BuyInAmount Selector component; Added index; Added tests --- app/index.tsx | 19 ++- components/BuyInSelector.tsx | 138 ++++++++++++++++++++ components/__tests__/BuyInSelector.test.tsx | 59 +++++++++ 3 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 components/BuyInSelector.tsx create mode 100644 components/__tests__/BuyInSelector.test.tsx diff --git a/app/index.tsx b/app/index.tsx index 7c7e016..5183247 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -1,9 +1,17 @@ import React, { useState } from "react"; -import { ScrollView, Text } from "react-native"; +import { ScrollView, Text, Alert, Button } from "react-native"; import PlayerSelector from "@/components/PlayerSelector"; +import BuyInSelector from "@/components/BuyInSelector"; const IndexScreen = () => { const [playerCount, setPlayerCount] = useState(2); + const [buyInAmount, setBuyInAmount] = useState(null); + + const handleSave = () => { + if (buyInAmount === null) { + Alert.alert("Error", "Please select a valid buy-in amount"); + } + }; return ( @@ -15,7 +23,16 @@ const IndexScreen = () => { playerCount={playerCount} setPlayerCount={setPlayerCount} /> + + + +