You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AppStack.js 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import React from "react";
  2. import { createDrawerNavigator } from "@react-navigation/drawer";
  3. import CustomDrawer from "@components/CustomDrawer/CustomDrawer";
  4. import TabNavigator from "./TabNavigator";
  5. import Ionicons from "@expo/vector-icons/Ionicons";
  6. import SettingsScreen from "@screens/SettingsScreen";
  7. import ProfileScreen from "@screens/ProfileScreen";
  8. import { useTheme } from "@styles";
  9. import { useTranslation } from "react-i18next";
  10. const Drawer = createDrawerNavigator();
  11. const AppStack = () => {
  12. const { colors } = useTheme();
  13. const { t } = useTranslation();
  14. return (
  15. <Drawer.Navigator
  16. drawerContent={(props) => <CustomDrawer {...props} />}
  17. screenOptions={{
  18. headerShown: false,
  19. drawerActiveBackgroundColor: "#aa18ea",
  20. drawerActiveTintColor: "#fff",
  21. drawerInactiveTintColor: colors.textPrimary,
  22. drawerLabelStyle: {
  23. marginLeft: 5,
  24. fontSize: 16,
  25. },
  26. }}
  27. >
  28. <Drawer.Screen
  29. name="Home"
  30. component={TabNavigator}
  31. options={{
  32. title:t("sidebar.home"),
  33. drawerIcon: ({ color }) => (
  34. <Ionicons name="home-outline" size={22} color={color} />
  35. ),
  36. }}
  37. />
  38. <Drawer.Screen
  39. name='Profile'
  40. component={ProfileScreen}
  41. options={{
  42. title:t("sidebar.profile"),
  43. drawerIcon: ({ color }) => (
  44. <Ionicons name="person-outline" size={22} color={color} />
  45. ),
  46. }}
  47. />
  48. <Drawer.Screen
  49. name='Settings'
  50. component={SettingsScreen}
  51. options={{
  52. title: t("sidebar.settings"),
  53. drawerIcon: ({ color }) => (
  54. <Ionicons name="settings-outline" size={22} color={color} />
  55. ),
  56. }}
  57. />
  58. </Drawer.Navigator>
  59. );
  60. };
  61. export default AppStack;