GT2/Ejectable/components/EndScreenInfo.tsx

66 lines
1.6 KiB
TypeScript
Raw Normal View History

2021-08-24 00:02:05 +00:00
import * as WebBrowser from 'expo-web-browser';
import React, { useState} from 'react';
import { Button, StyleSheet, TouchableOpacity } from 'react-native';
import Colors from '../constants/Colors';
import { MonoText } from './StyledText';
import { Text, View } from './Themed';
import { TripSummary } from '../GT2';
export default function EndScreenInfo({ path }: { path: string }) {
return (
<View>
2021-08-26 03:46:39 +00:00
<View style={styles.summaryContainer}>
2021-08-24 00:02:05 +00:00
<Text
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
Summary of this trip:
</Text>
<TripSummary/>
2021-08-26 03:46:39 +00:00
<Text
2021-08-28 02:34:15 +00:00
style = {styles.helpLinkText}
2021-08-26 03:46:39 +00:00
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
2021-08-28 02:34:15 +00:00
{'Min trip for carbon accounting\n is 250 meters.'}
2021-08-26 03:46:39 +00:00
</Text>
2021-08-24 00:02:05 +00:00
</View>
<View style={styles.helpContainer}>
<TouchableOpacity onPress={handleHelpPress} style={styles.helpLink}>
<Text style={styles.helpLinkText} lightColor={Colors.light.tint}>
World Bank on Greenhouse Gas Accounting
</Text>
</TouchableOpacity>
</View>
</View>
);
}
function handleHelpPress() {
WebBrowser.openBrowserAsync(
'https://olc.worldbank.org/content/ghg-accounting-101-self-paced'
);
}
const styles = StyleSheet.create({
2021-08-26 03:46:39 +00:00
summaryContainer: {
2021-08-28 10:27:48 +00:00
marginVertical: -9,
2021-08-24 00:02:05 +00:00
alignItems: 'center',
marginHorizontal: 50,
},
helpContainer: {
2021-08-28 10:27:48 +00:00
marginTop: 10,
2021-08-24 00:02:05 +00:00
marginHorizontal: 20,
alignItems: 'center',
2021-08-26 03:46:39 +00:00
},
helpLink: {
2021-08-24 00:02:05 +00:00
paddingVertical: 15,
},
helpLinkText: {
textAlign: 'center',
},
2021-08-26 03:46:39 +00:00
2021-08-24 00:02:05 +00:00
});