Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

AppStack.js 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. unmountOnBlur: true,
  33. title:t("sidebar.home"),
  34. drawerIcon: ({ color }) => (
  35. <Ionicons name="home-outline" size={22} color={color} />
  36. ),
  37. }}
  38. />
  39. <Drawer.Screen
  40. name='Profile'
  41. component={ProfileScreen}
  42. options={{
  43. title:t("sidebar.profile"),
  44. drawerIcon: ({ color }) => (
  45. <Ionicons name="person-outline" size={22} color={color} />
  46. ),
  47. }}
  48. />
  49. <Drawer.Screen
  50. name='Settings'
  51. component={SettingsScreen}
  52. options={{
  53. title: t("sidebar.settings"),
  54. drawerIcon: ({ color }) => (
  55. <Ionicons name="settings-outline" size={22} color={color} />
  56. ),
  57. }}
  58. />
  59. </Drawer.Navigator>
  60. );
  61. };
  62. export default AppStack;