This repository has been archived by the owner on Sep 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
56 lines (51 loc) · 1.53 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
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import { kkAPIClient } from './api/KkAPIClient';
import { Environment } from './KkEnvironment';
import { createKkNavigation } from './navigation/KkNavigation';
import { localStorageService } from './services/KkLocalStorageService';
import useCachedResources from './utils/hooks/useCachedResources';
import useColorScheme from './utils/hooks/useColorScheme';
import styled from 'styled-components';
export default function App() {
const isLoadingComplete = useCachedResources();
const colorScheme = useColorScheme();
const { Navigator } = createKkNavigation();
Environment.set({
api: kkAPIClient({
baseUrl: 'https://api.clockify.me/api/v1',
}),
services: {
localStorage: localStorageService,
},
});
if (!isLoadingComplete) {
return null;
} else {
return (
<SafeAreaProvider>
<Navigator colorScheme={colorScheme} />
<StatusBar />
<ToastContainer
position='bottom-center'
hideProgressBar={true}
style={{ width: 'unset' }}
closeButton={false}
/>
</SafeAreaProvider>
);
}
}
const StyledToast = styled(ToastContainer).attrs({
// custom props
})`
/** Classes for the displayed toast **/
.Toastify__toast {
justify-content: center;
min-height: unset;
border-radius: 0;
}
`;