import { NativeStackScreenProps } from '@react-navigation/native-stack' import React, { useEffect } from 'react' import { useTranslation } from 'react-i18next' import { Image, StyleSheet, Text, View } from 'react-native' import { SafeAreaView } from 'react-native-safe-area-context' import AppAnalytics from 'src/analytics/AppAnalytics' import { PointsEvents } from 'src/analytics/Events' import BackButton from 'src/components/BackButton' import Button, { BtnSizes } from 'src/components/Button' import CustomHeader from 'src/components/header/CustomHeader' import { pointsIllustration } from 'src/images/Images' import { replace } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' import { StackParamList } from 'src/navigator/types' import { pointsIntroDismissed } from 'src/points/slice' import { useDispatch } from 'src/redux/hooks' import { typeScale } from 'src/styles/fonts' import { Spacing } from 'src/styles/styles' type Props = NativeStackScreenProps export default function PointsHome({ route, navigation }: Props) { const { t } = useTranslation() const dispatch = useDispatch() useEffect(() => { const unsubscribe = navigation.addListener('beforeRemove', () => { AppAnalytics.track(PointsEvents.points_intro_back) }) return unsubscribe }, [navigation]) const onIntroDismiss = () => { AppAnalytics.track(PointsEvents.points_intro_dismiss) dispatch(pointsIntroDismissed()) replace(Screens.PointsHome) } return ( } /> {t('points.intro.title')} {t('points.intro.description')}