2024-02-16 15:10:56 -08:00
|
|
|
import React from "react";
|
2024-02-12 10:28:42 -08:00
|
|
|
import {
|
|
|
|
ActivityIndicator,
|
|
|
|
Keyboard,
|
|
|
|
Text,
|
|
|
|
TextInput,
|
|
|
|
TouchableOpacity,
|
|
|
|
TouchableWithoutFeedback,
|
|
|
|
View,
|
|
|
|
} from "react-native";
|
|
|
|
import DropDownPicker from "react-native-dropdown-picker";
|
2024-02-16 15:10:56 -08:00
|
|
|
import { useVideoDetails } from "../../component/video/use-video-details";
|
2024-02-12 10:28:42 -08:00
|
|
|
import { globalInputStyles } from "../../styles";
|
|
|
|
import { recordStyles as styles } from "./styles";
|
|
|
|
|
2024-02-16 15:10:56 -08:00
|
|
|
export default function VideoDetails({ navigation, route }): React.JSX.Element {
|
2024-02-19 13:19:21 -08:00
|
|
|
const { mode } = route.params;
|
2024-02-16 15:10:56 -08:00
|
|
|
const {
|
|
|
|
sessionName,
|
|
|
|
setSessionName,
|
|
|
|
gameType,
|
|
|
|
tableSize,
|
|
|
|
handleSubmit,
|
|
|
|
loading,
|
2024-02-19 13:19:21 -08:00
|
|
|
} = useVideoDetails({ params: route.params, navigation });
|
2024-02-12 10:28:42 -08:00
|
|
|
|
|
|
|
const dropDownStyles = {
|
|
|
|
style: globalInputStyles.dropdownStyle,
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<TouchableWithoutFeedback onPress={() => Keyboard.dismiss()}>
|
|
|
|
<View style={styles.container}>
|
|
|
|
<Text style={styles.headerText}>
|
|
|
|
{mode === "start-video" ? "Record Session" : "Save Session"}
|
|
|
|
</Text>
|
|
|
|
<View style={globalInputStyles.dropdownContainer}>
|
|
|
|
<Text style={globalInputStyles.dropdownTitle}>Session Name</Text>
|
|
|
|
<TextInput
|
|
|
|
style={globalInputStyles.input}
|
|
|
|
placeholder="Session name"
|
|
|
|
autoCapitalize="none"
|
|
|
|
value={sessionName}
|
|
|
|
onChangeText={setSessionName}
|
|
|
|
/>
|
|
|
|
<Text style={globalInputStyles.dropdownTitle}>Game Type</Text>
|
|
|
|
<DropDownPicker
|
|
|
|
zIndex={3000}
|
|
|
|
zIndexInverse={1000}
|
2024-02-19 13:19:21 -08:00
|
|
|
open={gameType.isOpen}
|
|
|
|
value={gameType.value}
|
|
|
|
items={gameType.optionsList}
|
|
|
|
setOpen={gameType.toggleOpen}
|
|
|
|
setValue={gameType.setValue}
|
|
|
|
setItems={gameType.setOptionsList}
|
2024-02-12 10:28:42 -08:00
|
|
|
{...dropDownStyles}
|
|
|
|
/>
|
2024-02-19 13:19:21 -08:00
|
|
|
<Text style={globalInputStyles.dropdownTitle}>Table Size</Text>
|
2024-02-12 10:28:42 -08:00
|
|
|
<DropDownPicker
|
|
|
|
zIndex={2000}
|
|
|
|
zIndexInverse={2000}
|
2024-02-19 13:19:21 -08:00
|
|
|
open={tableSize.isOpen}
|
|
|
|
value={tableSize.value}
|
|
|
|
items={tableSize.optionsList}
|
|
|
|
setOpen={tableSize.toggleOpen}
|
|
|
|
setValue={tableSize.setValue}
|
|
|
|
setItems={tableSize.setOptionsList}
|
2024-02-12 10:28:42 -08:00
|
|
|
{...dropDownStyles}
|
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={styles.buttonContainer}>
|
|
|
|
{mode === "start-video" && (
|
|
|
|
<TouchableOpacity
|
|
|
|
style={styles.buttonStyle}
|
|
|
|
onPress={() => navigation.goBack()}
|
|
|
|
>
|
|
|
|
<Text style={styles.buttonText}>Back</Text>
|
|
|
|
</TouchableOpacity>
|
|
|
|
)}
|
|
|
|
<TouchableOpacity style={styles.buttonStyle} onPress={handleSubmit}>
|
|
|
|
{loading ? (
|
|
|
|
<ActivityIndicator color="#fff" />
|
|
|
|
) : (
|
|
|
|
<Text style={styles.buttonText}>
|
|
|
|
{mode === "start-video" ? "Next" : "Save"}
|
|
|
|
</Text>
|
|
|
|
)}
|
|
|
|
</TouchableOpacity>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</TouchableWithoutFeedback>
|
|
|
|
);
|
|
|
|
}
|