import {getFocusedRouteNameFromRoute} from '@react-navigation/native'; import {createNativeStackNavigator} from '@react-navigation/native-stack'; import React, {useState} from 'react'; import {useTranslation} from 'react-i18next'; import {Row, Text} from '../components/ui'; import {Header} from '../components/ui/Header'; import {Theme} from '../components/ui/styleUtils'; import {RootRouteProps} from '../routes'; import {HomeScreen} from './Home/HomeScreen'; import {IssuersScreen} from './Issuers/IssuersScreen'; import {SvgImage} from '../components/ui/svg'; import {HelpScreen} from '../components/HelpScreen'; import {I18nManager, View} from 'react-native'; import {isIOS} from '../shared/constants'; import {Copilot} from '../components/ui/Copilot'; import LinearGradient from 'react-native-linear-gradient'; export const HomeScreenLayout: React.FC = props => { const {t} = useTranslation('IssuersScreen'); const {Navigator, Screen} = createNativeStackNavigator(); React.useLayoutEffect(() => { const routeName = getFocusedRouteNameFromRoute(props.route); if (routeName === 'IssuersScreen') { props.navigation.setOptions({tabBarStyle: {display: 'none'}}); } else { props.navigation.setOptions({ tabBarShowLabel: true, tabBarActiveTintColor: Theme.Colors.IconBg, tabBarLabelStyle: { fontSize: 12, fontFamily: 'Montserrat_600SemiBold', }, tabBarStyle: { height: 75, paddingHorizontal: 10, }, tabBarItemStyle: { height: 83, padding: 11, }, }); } }, [props.navigation, props.route]); const screenOptions = ( {SvgImage.coloredInfo()} {t('help')} } /> } /> ); const [isRTL] = useState(I18nManager.isRTL); const HomeScreenOptions = { headerLeft: () => isIOS() || !isRTL ? ( {SvgImage.InjiLogo(Theme.Styles.injiLogo)} ) : ( screenOptions ), headerTitle: '', headerRight: () => isIOS() || !isRTL ? ( screenOptions ) : ( {SvgImage.InjiLogo(Theme.Styles.injiLogo)} ), }; return ( (
), }} /> ); };