2024-06-26 04:20:08 +02:00
|
|
|
import { Tabs } from 'expo-router';
|
|
|
|
|
|
|
|
import { Colors } from '@/constants/Colors';
|
|
|
|
import { useColorScheme } from '@/hooks/useColorScheme';
|
2024-06-27 23:31:59 +02:00
|
|
|
import { TabBarIcon } from '@/components/navigation/TabBarIcon';
|
2024-06-29 02:04:30 +02:00
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
import { products as fixtures } from "@/__fixtures__/initialProducts"
|
|
|
|
import { setupStore } from '../store';
|
2024-06-26 04:20:08 +02:00
|
|
|
|
|
|
|
export default function TabLayout() {
|
|
|
|
const colorScheme = useColorScheme();
|
2024-06-29 02:04:30 +02:00
|
|
|
const store = setupStore({
|
2024-06-30 18:37:27 +02:00
|
|
|
products: fixtures.map(p => p.asObject)
|
2024-06-29 02:04:30 +02:00
|
|
|
});
|
2024-06-26 04:20:08 +02:00
|
|
|
return (
|
2024-06-29 02:04:30 +02:00
|
|
|
<Provider store={store}>
|
|
|
|
<Tabs
|
|
|
|
screenOptions={{
|
|
|
|
tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
|
|
|
|
headerShown: false,
|
|
|
|
}}>
|
|
|
|
<Tabs.Screen
|
|
|
|
name="index"
|
|
|
|
options={{
|
2024-07-01 21:23:45 +02:00
|
|
|
title: 'Home Screen',
|
2024-06-29 02:04:30 +02:00
|
|
|
tabBarIcon: ({ color, focused }) => (
|
2024-07-01 21:23:45 +02:00
|
|
|
<TabBarIcon name={focused ? 'scale' : 'scale-outline'} color={color} />
|
2024-06-29 02:04:30 +02:00
|
|
|
),
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Tabs.Screen
|
|
|
|
name="product-editor"
|
|
|
|
options={{
|
|
|
|
title: 'Products',
|
|
|
|
tabBarIcon: ({ color, focused }) => (
|
2024-07-01 21:23:45 +02:00
|
|
|
<TabBarIcon name={focused ? 'list' : 'list-outline'} color={color} />
|
2024-06-29 02:04:30 +02:00
|
|
|
),
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Tabs>
|
|
|
|
</Provider>
|
2024-06-26 04:20:08 +02:00
|
|
|
);
|
|
|
|
}
|