Add press handlers to buttons

This commit is contained in:
Julia Friesel
2018-12-23 16:46:10 +01:00
parent 000e1b63c7
commit 2c1b856234
4 changed files with 37 additions and 18 deletions
+16 -4
View File
@@ -1,19 +1,31 @@
import React from 'react'
import { ScrollView, View } from 'react-native'
import { ScrollView, View, BackHandler } from 'react-native'
import AppText from './app-text'
import { licenseText, shared } from '../i18n/en/labels'
import styles,{secondaryColor} from '../styles'
import Button from './button'
import { saveLicenseFlag } from '../local-storage';
export default function License() {
export default function License({setLicense}) {
return (
<ScrollView style={styles.licensePage}>
<AppText>{licenseText}</AppText>
<View style={styles.licenseButtons}>
<Button style={styles.licenseButton} backgroundColor={'grey'}>
<Button
style={styles.licenseButton}
backgroundColor={'grey'}
onPress={() => BackHandler.exitApp()}
>
{shared.cancel}
</Button>
<Button style={styles.licenseButton} backgroundColor={secondaryColor}>
<Button
style={styles.licenseButton}
backgroundColor={secondaryColor}
onPress={async () => {
await saveLicenseFlag()
setLicense()
}}
>
{shared.ok}
</Button>
</View>