Newer
Older
import PropTypes from 'prop-types'
import { BackHandler, StyleSheet, View } from 'react-native'
import { useTranslation } from 'react-i18next'
import AppText from './common/app-text'
import Button from './common/button'
import { saveLicenseFlag } from '../local-storage'
export default function License({ setLicense }) {
const onAcceptLicense = async () => {
await saveLicenseFlag()
setLicense()
}
const { t } = useTranslation()
const currentYear = new Date().getFullYear()
<Segment last testID="test" title={t("settings.license.title")}>
<AppText testID="test">{t("settings.license.text", { currentYear })}</AppText>
<Button onPress={BackHandler.exitApp} testID="licenseCancelButton">
{t("labels.shared.cancel")}
<Button isCTA onPress={onAcceptLicense} testID="licenseOkButton">
{t("labels.shared.ok")}
</Button>
</View>
</Segment>
</AppPage>
}
License.propTypes = {
setLicense: PropTypes.func.isRequired
}