import { useRoute, RouteProp } from '@react-navigation/native' import React from 'react' import { Linking, StyleSheet, View, ScrollView } from 'react-native' import { Heading } from '../../components' import { Icon, Text, TextInlineButton } from '../../components/display' import { useTheme } from '../../hooks' import type { AgeCheckParams } from './screen_props' export interface AgeCheckUnderageScreenProps { contactEmail?: string } export function AgeCheckUnderageScreen({ contactEmail }: AgeCheckUnderageScreenProps = {}) { const styles = useStyles() const route = useRoute>() const email = contactEmail ?? route?.params?.contactEmail const openChurchAdminHelp = () => { if (!email) return Linking.openURL(`mailto:${email}`) } const openTerms = () => { Linking.openURL('https://www.planningcenter.com/terms') } return ( Chat is only available for users 13 and older. If you submitted the wrong birthdate by accident,{` `} {email ? ( please contact your church administrator ) : ( <>please contact your church administrator )} {` `} to update your profile. For more information, view our{` `} terms of service . ) } const useStyles = () => { const { colors } = useTheme() return StyleSheet.create({ scrollView: { flex: 1, }, container: { alignItems: 'center', justifyContent: 'center', gap: 16, padding: 16, minHeight: '100%', }, icon: { color: colors.iconColorDefaultDisabled, }, content: { alignItems: 'center', gap: 8, maxWidth: 250, }, baseText: { textAlign: 'center', color: colors.textColorDefaultSecondary, }, linkText: { fontSize: 14, }, }) }