From 00f8e427090210bb06260b6ff1daf9f4feed6fbe Mon Sep 17 00:00:00 2001 From: MantashaNoyela Date: Tue, 11 Feb 2025 17:09:28 -0800 Subject: [PATCH] Implemented code for Dark Background and Test --- app/index.tsx | 82 ++++++++++++------- components/DarkModeToggle.tsx | 46 +++++++++++ .../ChipDistributionSummary.test.tsx | 5 +- components/__tests__/DarkModeToggle.test.tsx | 25 ++++++ package-lock.json | 34 ++++++++ package.json | 1 + 6 files changed, 162 insertions(+), 31 deletions(-) create mode 100644 components/DarkModeToggle.tsx create mode 100644 components/__tests__/DarkModeToggle.test.tsx diff --git a/app/index.tsx b/app/index.tsx index eb5f1b3..e987b89 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -1,14 +1,18 @@ import React, { useState } from "react"; -import { ScrollView, Text, Alert, Button } from "react-native"; +import { ScrollView, Text, Alert, Button, View, StyleSheet } from "react-native"; import PlayerSelector from "@/components/PlayerSelector"; import BuyInSelector from "@/components/BuyInSelector"; import ChipsSelector from "@/components/ChipsSelector"; -import ChipDistributionSummary from "@/components/ChipDistributionSummary"; +import ChipDistributionSummary from "@/components/ChipDistributionSummary"; +import DarkModeToggle from "@/components/DarkModeToggle"; + const IndexScreen = () => { const [playerCount, setPlayerCount] = useState(2); const [buyInAmount, setBuyInAmount] = useState(null); const [numberOfChips, setNumberOfChips] = useState(5); const [totalChipsCount, setTotalChipsCount] = useState([]); + const [darkMode, setDarkMode] = useState(false); + const handleSave = () => { if (buyInAmount === null) { Alert.alert("Error", "Please select a valid buy-in amount"); @@ -19,33 +23,55 @@ const IndexScreen = () => { ); } }; + return ( - - - Poker Chip Helper - - - - - -