diff --git a/app/index.tsx b/app/index.tsx index 866b635..7c7e016 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -1,15 +1,21 @@ -import { Text, View } from "react-native"; +import React, { useState } from "react"; +import { ScrollView, Text } from "react-native"; +import PlayerSelector from "@/components/PlayerSelector"; + +const IndexScreen = () => { + const [playerCount, setPlayerCount] = useState(2); -export default function Index() { return ( - - Edit app/index.tsx to edit this screen. - + + + Poker Chip Helper + + + + ); -} +}; +export default IndexScreen; diff --git a/components/PlayerSelector.tsx b/components/PlayerSelector.tsx new file mode 100644 index 0000000..b51ff4c --- /dev/null +++ b/components/PlayerSelector.tsx @@ -0,0 +1,64 @@ +import React from "react"; +import { View, Text, Button, Image, StyleSheet } from "react-native"; + +interface PlayerSelectorProps { + playerCount: number; + setPlayerCount: React.Dispatch>; +} + +const PlayerSelector: React.FC = ({ + playerCount, + setPlayerCount, +}) => { + const increasePlayers = () => { + if (playerCount < 8) setPlayerCount(playerCount + 1); + }; + + const decreasePlayers = () => { + if (playerCount > 2) setPlayerCount(playerCount - 1); + }; + + return ( + + + + Select Number of Players: + + + {playerCount} + +