diff --git a/app/index.tsx b/app/index.tsx index eb5f1b3..77fdd18 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -3,7 +3,8 @@ import { ScrollView, Text, Alert, Button } 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 ChipDetection from "@/components/ChipDetection"; const IndexScreen = () => { const [playerCount, setPlayerCount] = useState(2); const [buyInAmount, setBuyInAmount] = useState(null); @@ -29,6 +30,10 @@ const IndexScreen = () => { setPlayerCount={setPlayerCount} /> + >; +}) => { + const [image, setImage] = useState(null); + const pickImage = async () => { + const { status } = await ImagePicker.requestMediaLibraryPermissionsAsync(); + if (status !== "granted") { + alert("Permission denied!"); + return; + } + + const result = await ImagePicker.launchCameraAsync({ + allowsEditing: true, + quality: 1, + }); + + if (!result.canceled) { + setImage(result.assets[0].uri); + } + }; + + return ( + + Automatic Detection + + + ); +}; + +export default ChipDetection; diff --git a/components/__tests__/ChipDetection.test.tsx b/components/__tests__/ChipDetection.test.tsx new file mode 100644 index 0000000..dd1d010 --- /dev/null +++ b/components/__tests__/ChipDetection.test.tsx @@ -0,0 +1,18 @@ +import ChipDetection from "@/components/ChipDetection"; +import { render } from "@testing-library/react-native"; +import React from "react"; + +const totalChipsCount: number[] = []; +const mockSetTotalChipsCount = jest.fn(); + +const rend = render( + +); + +describe("tests for ChipDetection", () => { + it.todo("first test"); + it.todo("second test"); +}); diff --git a/package.json b/package.json index c971594..6a81707 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ "react-native-safe-area-context": "4.12.0", "react-native-screens": "~4.4.0", "react-native-web": "~0.19.13", - "react-native-webview": "13.12.5" + "react-native-webview": "13.12.5", + "expo-image-picker": "~16.0.6" }, "devDependencies": { "@babel/core": "^7.25.2",