GT2/Ejectable/screens/ModalScreen.tsx

44 lines
1.3 KiB
TypeScript
Raw Permalink Normal View History

2021-08-24 00:02:05 +00:00
import { StatusBar } from 'expo-status-bar';
import * as React from 'react';
2021-08-24 15:43:25 +00:00
import { Button, Platform, StyleSheet } from 'react-native';
2021-08-24 00:02:05 +00:00
import EndScreenInfo from '../components/EndScreenInfo';
import { Text, View } from '../components/Themed';
2021-08-24 15:43:25 +00:00
import { RootTabScreenProps } from '../types';
2021-08-24 00:02:05 +00:00
2021-08-25 07:59:02 +00:00
var advised:boolean = false;
export function getAdvised() : boolean { return advised; }
export function setAdvised() : void { advised = true; }
2021-08-24 15:43:25 +00:00
export default function ModalScreen({ navigation }: RootTabScreenProps<'Settings'>) {
2021-08-24 00:02:05 +00:00
return (
<View style={styles.container}>
2021-08-24 15:43:25 +00:00
<Text style={styles.title}>Carbon Impact</Text>
2021-08-24 00:02:05 +00:00
<View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" />
<EndScreenInfo path="/screens/ModalScreen.tsx" />
2021-08-24 15:43:25 +00:00
<Button title={'Dismiss'}
onPress={() => { navigation.goBack(); }}
/>
2021-08-24 00:02:05 +00:00
{/* Use a light status bar on iOS to account for the black space above the modal */}
<StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
title: {
fontSize: 20,
fontWeight: 'bold',
},
separator: {
2021-08-28 10:27:48 +00:00
marginVertical: 5,
2021-08-24 00:02:05 +00:00
height: 1,
width: '80%',
},
});