// eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable import/namespace */ import 'expo-dev-client' import { useMemo, useState } from 'react' import { useNavigation, useRoute } from '@react-navigation/native' import { createNativeStackNavigator } from '@react-navigation/native-stack' import { Heading, IconButton, Paragraph } from '@status-im/components' import { Avatar } from '@status-im/components/src/avatar' import { ArrowLeftIcon, MembersIcon } from '@status-im/icons' import { Stack as View, TamaguiProvider } from '@tamagui/core' import { useFonts } from 'expo-font' import { Platform } from 'react-native' import { SafeAreaProvider } from 'react-native-safe-area-context' import { AnimatePresence } from 'tamagui' import { NavigationProvider } from './navigation/provider' import { ChannelScreen } from './screens/channel' import { HomeScreen } from './screens/home' import tamaguiConfig from './tamagui.config' import type { RouteProp } from '@react-navigation/native' import type { HeaderBackButtonProps } from '@react-navigation/native-stack/lib/typescript/src/types' export type RootStackParamList = { Home: undefined Channel: { channelId: string } } const Stack = createNativeStackNavigator() const CustomHeaderLeft = (props: HeaderBackButtonProps) => { const navigation = useNavigation() const route = useRoute>() return ( <> } onPress={() => { props.canGoBack && navigation.goBack() }} /> # {route.params.channelId || 'channel'} ) } export default function App() { const [position, setPosition] = useState(0) const [loaded] = useFonts({ Inter: require('@tamagui/font-inter/otf/Inter-Medium.otf'), InterBold: require('@tamagui/font-inter/otf/Inter-Bold.otf'), // Tamagui does this for you on web, but you need to do it manually on native. Only for the demo. We should seek a better solution. UbuntuMono: require('./assets/fonts/UbuntuMono.ttf'), }) const onScroll = event => { if (event.nativeEvent.contentOffset.y > 90) { setPosition(event.nativeEvent.contentOffset.y) } else { setPosition(0) } } const showMinimizedHeader = useMemo(() => { return position > 90 }, [position]) if (!loaded) { return null } return ( ( {showMinimizedHeader && ( Rarible )} ), }} > {props => ( )} }, headerRight() { return ( } onPress={() => { // noop }} /> ) }, }} /> ) }