Skip to content

Commit d064ddf

Browse files
author
marekbukoski
committed
expo starter
0 parents  commit d064ddf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+14846
-0
lines changed

.eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@react-native-community', 'plugin:@typescript-eslint/recommended'],
4+
};

.gitignore

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
node_modules/**/*
2+
.expo/*
3+
.expo-shared/
4+
npm-debug.*
5+
*.jks
6+
*.p8
7+
*.p12
8+
*.key
9+
*.mobileprovision
10+
*.orig.*
11+
web-build/
12+
*.log
13+
14+
# macOS
15+
.DS_Store
16+
17+
*.env
18+
eas.json
19+
_scripts/
20+
.expo
21+
media/
22+
23+
# will be generated after `expo run:ios` or `expo run:android`
24+
ios/
25+
android/
26+
metro.config.js
27+
react-native.config.js
28+
index.js
29+
30+
# @generated expo-cli sync-e7dcf75f4e856f7b6f3239b3f3a7dd614ee755a8
31+
# The following patterns were generated by expo-cli
32+
33+
# OSX
34+
#
35+
.DS_Store
36+
37+
# Xcode
38+
#
39+
build/
40+
*.pbxuser
41+
!default.pbxuser
42+
*.mode1v3
43+
!default.mode1v3
44+
*.mode2v3
45+
!default.mode2v3
46+
*.perspectivev3
47+
!default.perspectivev3
48+
xcuserdata
49+
*.xccheckout
50+
*.moved-aside
51+
DerivedData
52+
*.hmap
53+
*.ipa
54+
*.xcuserstate
55+
project.xcworkspace
56+
57+
# Android/IntelliJ
58+
#
59+
build/
60+
.idea
61+
.gradle
62+
local.properties
63+
*.iml
64+
*.hprof
65+
66+
# node.js
67+
#
68+
node_modules/
69+
npm-debug.log
70+
yarn-error.log
71+
72+
# BUCK
73+
buck-out/
74+
\.buckd/
75+
*.keystore
76+
!debug.keystore
77+
78+
# Bundle artifacts
79+
*.jsbundle
80+
81+
# CocoaPods
82+
/ios/Pods/
83+
84+
# Expo
85+
.expo/
86+
web-build/
87+
dist/
88+
89+
# @end expo-cli

.prettierrc.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
singleQuote: true,
3+
trailingComma: 'all',
4+
printWidth: 100,
5+
bracketSpacing: false,
6+
arrowParens: 'avoid',
7+
};

.release-it.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"non-interactive": true,
3+
"git": {
4+
"requireCleanWorkingDir": true
5+
},
6+
"npm": {
7+
"publish": false
8+
},
9+
"github": {
10+
"release": true,
11+
"releaseName": "v${version}"
12+
}
13+
}

App.tsx

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import 'expo-dev-client';
2+
import React, {useCallback, useEffect, useMemo, useState} from 'react';
3+
import {LogBox} from 'react-native';
4+
5+
import * as Linking from 'expo-linking';
6+
import {StatusBar} from 'expo-status-bar';
7+
import * as SplashScreen from 'expo-splash-screen';
8+
import {GestureHandlerRootView} from 'react-native-gesture-handler';
9+
10+
import {NavioApp} from '@app/navio';
11+
import {
12+
configureDesignSystem,
13+
getNavigationTheme,
14+
getStatusBarBGColor,
15+
getStatusBarStyle,
16+
} from '@app/utils/designSystem';
17+
import {hydrateStores} from '@app/stores';
18+
import {initServices} from '@app/services';
19+
import {AppProvider} from '@app/utils/providers';
20+
import {useAppearance} from '@app/utils/hooks';
21+
22+
LogBox.ignoreLogs([
23+
'Require',
24+
'Found screens with the same name nested inside one another.', // for navio in some cases
25+
]);
26+
27+
export default (): JSX.Element => {
28+
useAppearance();
29+
const [ready, setReady] = useState(false);
30+
31+
// `onLaunch` performs actions that have to be done on app launch before displaying app UI.
32+
// If you need to make some api requests, load remote config, or some other "heavy" actions, you can use `@app/services/onLaunch.tsx`.
33+
const onLaunch = useCallback(async () => {
34+
await SplashScreen.preventAutoHideAsync();
35+
36+
await hydrateStores();
37+
configureDesignSystem();
38+
await initServices();
39+
40+
setReady(true);
41+
await SplashScreen.hideAsync();
42+
}, []);
43+
44+
useEffect(() => {
45+
onLaunch();
46+
}, [onLaunch]);
47+
48+
const NotReady = useMemo(() => {
49+
// [Tip]
50+
// You can show loading state here.
51+
return <></>;
52+
}, [ready]);
53+
54+
if (!ready) return NotReady;
55+
return (
56+
<GestureHandlerRootView style={{flex: 1}}>
57+
<AppProvider>
58+
<StatusBar style={getStatusBarStyle()} backgroundColor={getStatusBarBGColor()} />
59+
<NavioApp
60+
navigationContainerProps={{
61+
theme: getNavigationTheme(),
62+
linking: {
63+
prefixes: [Linking.createURL('/')],
64+
},
65+
}}
66+
67+
// [Tip]
68+
// You can use `root` to change the root of the app depending on global state changes.
69+
// root={isLoggedIn ? 'AuthStack' : 'AppTabs'}
70+
/>
71+
</AppProvider>
72+
</GestureHandlerRootView>
73+
);
74+
};

0 commit comments

Comments
 (0)