GT2/Ejectable/components/ScreenInfo.tsx

131 lines
3.1 KiB
TypeScript
Raw Permalink Normal View History

2021-08-16 22:39:34 +00:00
import React from 'react';
import { StyleSheet, TouchableOpacity } from 'react-native';
import { Text, View } from './Themed';
2021-08-28 02:34:15 +00:00
import * as Device from 'expo-device';
2021-08-28 22:36:13 +00:00
import { ver } from '../GT2';
2021-08-16 22:39:34 +00:00
2021-08-17 19:34:08 +00:00
export default function ScreenInfo() {
2021-08-16 22:39:34 +00:00
return (
<View style={styles.settingsContainer}>
<Text
2021-08-28 02:34:15 +00:00
style={styles.switchText}
2021-08-16 22:39:34 +00:00
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
2021-08-28 02:34:15 +00:00
{'Switch dark: km, light: mi'}
2021-08-17 19:34:08 +00:00
</Text>
</View>
);
}
export function ScreenInfo2() {
return (
2021-08-28 03:34:05 +00:00
<View>
2021-08-17 19:34:08 +00:00
<Text
2021-08-28 03:34:05 +00:00
style={styles.tripControlText}
2021-08-17 19:34:08 +00:00
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
2021-08-28 03:34:05 +00:00
{'Pause trip if fuel burning interrupted.\n'}
</Text>
2021-08-16 22:39:34 +00:00
</View>
);
}
2021-08-28 02:34:15 +00:00
export function ScreenInfo4() {
return (
<View style={styles.settingsContainer}>
<Text
style={styles.sensitive}
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
2021-08-28 03:34:05 +00:00
{'set CO2 rate above or \nselect fuel type below\nhigher sensitivity may cause\n spurious motion at rest'}
2021-08-28 02:34:15 +00:00
</Text>
</View>
);
}
export function ScreenInfo5() {
return (
<View style={styles.settingsContainer}>
<Text
style={styles.sensitive}
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
{'set CO2 rate or use fuel type buttons below'}
</Text>
</View>
);
}
2021-08-16 22:39:34 +00:00
2021-08-17 22:00:09 +00:00
export function ScreenInfo3() {
return (
2021-08-21 07:45:27 +00:00
<View style={styles.splashContainer}>
2021-08-17 22:00:09 +00:00
<Text
2021-08-21 07:45:27 +00:00
style={styles.titleText}
2021-08-17 22:00:09 +00:00
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
2021-08-28 22:36:13 +00:00
{'Green Travel Calculator v. ' + ver }
2021-08-18 18:21:15 +00:00
</Text>
<Text
style={styles.versionText}
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
2021-08-28 02:34:15 +00:00
expo {Device.osName == 'iOS' ? 'iOS ' : 'android '} version
2021-08-17 22:00:09 +00:00
</Text>
2021-08-26 03:46:39 +00:00
<Text
style={styles.cautionText}
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
2021-08-28 02:34:15 +00:00
{'\nNote: accuracy depends on sensitivity setting, your device, and carrier.'}
2021-08-26 03:46:39 +00:00
</Text>
2021-08-17 22:00:09 +00:00
</View>
);
}
2021-08-16 22:39:34 +00:00
const styles = StyleSheet.create({
2021-08-21 07:45:27 +00:00
splashContainer: {
marginHorizontal: 50,
marginVertical: 20,
backgroundColor: 'rgba(0, 0, 0, 0)',
},
2021-08-16 22:39:34 +00:00
settingsContainer: {
marginHorizontal: 50,
2021-08-17 19:34:08 +00:00
marginVertical: 20,
2021-08-16 22:39:34 +00:00
},
2021-08-28 02:34:15 +00:00
sensitive: {
fontWeight: 'bold',
2021-08-28 03:34:05 +00:00
fontSize: 14,
textAlign: 'center',
2021-08-28 02:34:15 +00:00
},
2021-08-21 07:45:27 +00:00
titleText: {
color: 'white',
fontSize: 17,
lineHeight: 24,
textAlign: 'center',
},
2021-08-28 02:34:15 +00:00
switchText: {
fontSize: 10,
lineHeight: 24,
textAlign: 'center',
},
2021-08-16 22:39:34 +00:00
settingsText: {
fontSize: 17,
lineHeight: 24,
textAlign: 'center',
},
2021-08-28 03:34:05 +00:00
tripControlText: {
fontSize: 14,
fontWeight: 'bold',
lineHeight: 24,
textAlign: 'center',
},
2021-08-18 18:21:15 +00:00
versionText: {
2021-08-21 07:45:27 +00:00
color: 'yellow',
fontSize: 10,
2021-08-18 18:21:15 +00:00
textAlign: 'center',
},
2021-08-26 03:46:39 +00:00
cautionText: {
top: 90,
color: 'white',
fontSize: 14,
textAlign: 'center',
},
2021-08-16 22:39:34 +00:00
});