-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.tsx
70 lines (64 loc) · 1.95 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import 'react-native-gesture-handler';
import React, { useState } from 'react';
import { StatusBar } from 'react-native';
import RootStack from './src/navigation/RootStack';
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
import {
stackContext,
TGalleryStack,
TPopupStack,
TWriteStack,
} from './src/lib/context/useStackContext';
import { NavigationContainer } from '@react-navigation/native';
import { cameraContext } from '@/lib/context/useCameraContext';
import { useRef } from 'react';
type TProps = {};
export type TGuideImage = {
isGuideImage: boolean;
guideImage: string | null;
};
// Initialize Apollo Client
const client = new ApolloClient({
uri: 'localhost:4000/graphql',
cache: new InMemoryCache(),
});
const App = ({}: TProps) => {
const [GalleryStackType, setGalleryStack] = useState<TGalleryStack>('Select');
const [PopupStackType, setPopupStackType] = useState<TPopupStack>('SelectGuide');
const [WriteStackType, setWriteStackType] = useState<TWriteStack>('SavePhoto');
const [mirrorImage, setMirrorImage] = useState(false);
const [guideImage, setGuideImage] = useState<TGuideImage>({
isGuideImage: false,
guideImage: null,
});
const [quality, setQuality] = useState(true);
return (
<ApolloProvider client={client}>
<StatusBar barStyle="light-content" />
<stackContext.Provider
value={{
GalleryStackType,
setGalleryStack,
PopupStackType,
setPopupStackType,
WriteStackType,
setWriteStackType,
}}>
<cameraContext.Provider
value={{
mirrorImage,
setMirrorImage,
guideImage,
setGuideImage,
quality,
setQuality,
}}>
<NavigationContainer>
<RootStack />
</NavigationContainer>
</cameraContext.Provider>
</stackContext.Provider>
</ApolloProvider>
);
};
export default App;