import React, { useEffect } from 'react'; import { Dimensions, Image, TouchableOpacity, useWindowDimensions, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import SettingsService from '../../services/settings'; import { useSettingStore } from '../../stores/use-setting-store'; import { useThemeStore } from '../../stores/use-theme-store'; import { getElevation } from '../../utils'; import umami from '../../utils/analytics'; import { tabBarRef } from '../../utils/global-refs'; import { useNavigationFocus } from '../../utils/hooks/use-navigation-focus'; import { SIZE } from '../../utils/size'; import { Button } from '../ui/button'; import { SvgView } from '../ui/svg'; import { BouncingView } from '../ui/transitions/bouncing-view'; import Heading from '../ui/typography/heading'; import Paragraph from '../ui/typography/paragraph'; let SVG_D = ``; export const SVG_Z = ``; const Intro = ({ navigation, route }) => { const colors = useThemeStore(state => state.colors); const introCompleted = SettingsService.get().introCompleted; const isTelemetryEnabled = useSettingStore(state => state.settings.telemetry); const { height } = useWindowDimensions(); const insets = useSafeAreaInsets(); useNavigationFocus(navigation, { onFocus: () => { tabBarRef.current.lock(); } }); useEffect(() => { if (!introCompleted) { umami.pageView('/welcome', '', []); } }, [introCompleted]); return ( 200 ? 200 : height / 4} height={height / 4 > 200 ? 200 : height / 4} src={SVG_D} /> Safe & encrypted notes {`Write with freedom.\nNever compromise on\nprivacy again.`} { await SettingsService.set({ telemetry: !isTelemetryEnabled }); }} > Help improve Notesnook by sending completely anonymized{' '} private analytics and bug reports.