import React, { useCallback, useState } from "react"; import { Keyboard, Text, TextInput, TouchableOpacity, TouchableWithoutFeedback, View, } from "react-native"; import DropDownPicker from "react-native-dropdown-picker"; import { recordStyles as styles } from "./styles"; interface CameraScreenParams { gameType: string; tableSize: string; tags: Array; location: string; } // Record Screen // Precedes Camera.tsx // Can be made into Modal when ready export default function RecordScreen({ navigation }): React.JSX.Element { // Game type dropdown const [gameTypeOpen, setGameTypeOpen] = useState(false); const [gameType, setGameType] = useState(null); // This is a dropdown const [gameTypes, setGameTypes] = useState([ { label: "Free Play", value: "freePlay" }, { label: "Straight Pool", value: "straightPool" }, { label: "Nine Ball", value: "nineBall" }, ]); const onGameTypeOpen = useCallback(() => { setTableSizeOpen(false); setTagsOpen(false); }, []); // Table size dropdown const [tableSizeOpen, setTableSizeOpen] = useState(false); const [tableSize, setTableSize] = useState(""); const [tableSizes, setTableSizes] = useState([ { label: `9'`, value: "nineFoot" }, { label: `8'`, value: "eightFoot" }, { label: "7", value: "sevenFoot" }, ]); const onTableSizeOpen = useCallback(() => { setGameTypeOpen(false); setTagsOpen(false); }, []); // Tags multi-select dropdown const [tagsOpen, setTagsOpen] = useState(false); const [tags, setTags] = useState>([]); const [tagsList, setTagsList] = useState([ { label: `Tag1`, value: "tag1" }, { label: `Tag2`, value: "tag2" }, { label: "Tag3", value: "tag3" }, ]); const onTagsOpen = useCallback(() => { setTableSizeOpen(false); setGameTypeOpen(false); }, []); // Location const [location, setLocation] = useState(""); const handleSubmit = () => { // needs to pass info as params or store in a context/state provider const params: CameraScreenParams = { gameType: gameType, tableSize: tableSize, tags: tags, location: location, }; navigation.push("Camera", params); }; const dropDownStyles = { style: styles.dropdownStyle, }; return ( Keyboard.dismiss()}> Game Type Table size Tags Location setLocation(value)} /> navigation.goBack()} > Back Next ); }