-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
37 lines (33 loc) · 1.16 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import CategoryDetail from './src/layouts/CategoryDetail';
import CardButton from './src/components/CardButton';
import { QueryClient, QueryClientProvider } from 'react-query';
import './src/server';
import { LogBox } from 'react-native';
type RootStackParamList = {
CategoryDetail: { category: string };
};
const App = () => {
const Stack = createStackNavigator<RootStackParamList>();
const client = new QueryClient();
LogBox.ignoreLogs(['Setting a timer']);
return (
<QueryClientProvider client={client}>
<NavigationContainer>
<Stack.Navigator initialRouteName="CategoryDetail">
<Stack.Screen
name="CategoryDetail"
component={CategoryDetail}
initialParams={{ category: 'Personal Care' }}
options={({ route }) => ({
header: () => <CardButton type="banner" label={route?.params?.category} />,
})}
/>
</Stack.Navigator>
</NavigationContainer>
</QueryClientProvider>
);
};
export default App;