LandingPageNavigator.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { View, Text } from 'react-native'
  2. import React from 'react'
  3. import { createDrawerNavigator } from '@react-navigation/drawer'
  4. import LandingPage from '../screens/LandingPage'
  5. import NewscoutHomeHeader from '../components/organisms/Headers/NewscoutHomeHeader'
  6. import metrics from '../theme/metrics'
  7. const Drawer = createDrawerNavigator()
  8. const SidebarContent = (props) => {
  9. return (
  10. <View><Text>SidebarContent</Text></View>
  11. );
  12. }
  13. const LandingPageNavigator = () => {
  14. const isLargeScreen = metrics.screenWidth >= 768;
  15. return (
  16. <Drawer.Navigator
  17. initialRouteName='LandingPage'
  18. screenOptions={{
  19. drawerType: 'front',
  20. drawerStyle: isLargeScreen ? null : { width: '100%' },
  21. }}
  22. drawerContent={() => <SidebarContent/>}
  23. >
  24. <Drawer.Screen
  25. name="LandingPage"
  26. component={LandingPage}
  27. options={({ navigation }) => ({
  28. headerShown: true,
  29. header: () => <NewscoutHomeHeader onPress={() => navigation.toggleDrawer()} />
  30. })} />
  31. </Drawer.Navigator>
  32. )
  33. }
  34. export default LandingPageNavigator