Skip to content
Snippets Groups Projects

Added custom drawer

Merged John Fredrik Bendvold requested to merge drawer-items into main
2 files
+ 124
37
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 32
37
@@ -2,49 +2,44 @@ import { Stack } from "expo-router";
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { Drawer } from 'expo-router/drawer';
import Ionicons from '@expo/vector-icons/Ionicons';
import { View } from 'react-native';
import CustomDrawer from "../../components/drawer/custom-drawer";
export default function Layout() {
export default function Layout() {
return (
<>
<Stack.Screen options={{ headerShown: false }} />
<GestureHandlerRootView style={{ flex: 1 }}>
<Drawer
screenOptions={{
headerShown: false,
headerStyle: {
backgroundColor: '#F7EDE2',
},
headerTintColor: '#333',
headerTitleStyle: {
fontWeight: 'bold',
fontFamily: 'Nunito-Bold',
},
drawerActiveTintColor: '#84A59D',
drawerLabelStyle: {
fontFamily: 'Nunito',
fontSize: 16,
},
}}
>
<Drawer.Screen name="orders"
<Stack.Screen options={{ headerShown: false }} />
<GestureHandlerRootView style={{ flex: 1 }}>
<Drawer
screenOptions={{
headerShown: false,
drawerActiveTintColor: '#84A59D',
drawerLabelStyle: {
fontFamily: 'Nunito',
fontSize: 16,
},
}}
drawerContent={CustomDrawer}
>
<Drawer.Screen name="orders"
options={{
title: 'Bestillinger',
drawerLabel: 'Bestillinger',
drawerIcon: ({ focused, color, size }) => {
return <Ionicons name={focused ? 'cart' : 'cart-outline'} size={36} color={color} />;
},
}}
/>
<Drawer.Screen name="location"
options={{
title: 'Bestillinger',
drawerLabel: 'Bestillinger',
title: 'Ditt utsalg',
drawerIcon: ({ focused, color, size }) => {
return <Ionicons name={focused ? 'cart' : 'cart-outline'} size={36} color={color} />;
},
return <Ionicons name={focused ? 'storefront' : 'storefront-outline'} size={36} color={color} />;
}
}}
/>
<Drawer.Screen name="location"
options={{
title: 'Ditt utsalg',
drawerIcon: ({ focused, color, size }) => {
return <Ionicons name={focused ? 'storefront' : 'storefront-outline'} size={36} color={color} />;
}
}}
/>
</Drawer>
</GestureHandlerRootView>
/>
</Drawer>
</GestureHandlerRootView>
</>
);
}
\ No newline at end of file
Loading