add record entry screen/modal and required nav flow
This commit is contained in:
@@ -15,7 +15,15 @@ import { RecordingButton } from "./capture-button";
|
||||
import { useIsForeground } from "./is-foreground";
|
||||
import { useIsFocused } from "@react-navigation/native";
|
||||
|
||||
export default function CameraScreen(): React.ReactElement {
|
||||
export default function CameraScreen({ route, navigation }): React.ReactElement {
|
||||
// TODO: #73 Does this need to be passed to Camera component?
|
||||
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
||||
const { gameType, tableSize, tags, location } = route.params
|
||||
// LOG for params -- Remove when no longer needed
|
||||
// Note: camelCased value being passed, change on record.tsx if you want a different value format
|
||||
console.log(gameType, tableSize, tags, location)
|
||||
|
||||
|
||||
const camera = useRef<Camera>(null);
|
||||
const { hasPermission, requestPermission } = useCameraPermission();
|
||||
const [isCameraInitialized, setIsCameraInitialized] =
|
||||
@@ -63,6 +71,7 @@ export default function CameraScreen(): React.ReactElement {
|
||||
);
|
||||
};
|
||||
|
||||
// Replace with error handling
|
||||
if (device === null) {
|
||||
console.log(device);
|
||||
return (
|
||||
@@ -86,6 +95,9 @@ export default function CameraScreen(): React.ReactElement {
|
||||
orientation={orientation} // TODO: #60
|
||||
isActive={isActive}
|
||||
/>
|
||||
<View style={orientation === "portrait" ? styles.goBackPortrait : styles.goBackLandscape}>
|
||||
<Button title="Go back" onPress={() => navigation.goBack()} />
|
||||
</View>
|
||||
<RecordingButton
|
||||
style={[
|
||||
styles.captureButton,
|
||||
@@ -143,4 +155,15 @@ const styles = StyleSheet.create({
|
||||
bottom: "40%", // Should come from SafeAreaProvider
|
||||
left: 20, // needs refined
|
||||
},
|
||||
goBackPortrait: {
|
||||
position: 'absolute',
|
||||
top: 20, // or wherever you want the button to be positioned in portrait
|
||||
left: 20, // or wherever you want the button to be positioned in portrait
|
||||
},
|
||||
goBackLandscape: {
|
||||
position: 'absolute',
|
||||
top: 40,
|
||||
right: 20,
|
||||
transform: [{ rotate: '90deg' }],
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user