-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from kanzitelli/6.1.0
6.1.0
- Loading branch information
Showing
13 changed files
with
139 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import 'expo-asset'; | ||
import 'react-native-gesture-handler'; | ||
import { Navigation } from 'react-native-navigation'; | ||
import { registerRootComponent } from 'expo'; | ||
|
||
import { startApp } from './src/App'; | ||
import ExpoApp from './src/screens/ExpoAppScreen'; | ||
|
||
registerRootComponent(ExpoApp); // Without this line, it was causing a crash on iOS (14?) in release build | ||
Navigation.events().registerAppLaunchedListener(() => { | ||
startApp(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
{ | ||
EXUpdatesURL = "https://exp.host/@my-expo-username/my-app-slug"; | ||
EXUpdatesSDKVersion = "39.0.0"; | ||
EXUpdatesEnabled = "NO"; | ||
EXUpdatesCheckOnLaunch = "ALWAYS"; | ||
EXUpdatesLaunchWaitMs = 0; | ||
} | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>EXUpdatesCheckOnLaunch</key> | ||
<string>ALWAYS</string> | ||
<key>EXUpdatesEnabled</key> | ||
<false/> | ||
<key>EXUpdatesLaunchWaitMs</key> | ||
<integer>0</integer> | ||
<key>EXUpdatesSDKVersion</key> | ||
<string>39.0.0</string> | ||
<key>EXUpdatesURL</key> | ||
<string>https://exp.host/@my-expo-username/my-app-slug</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import { StyleSheet, View } from 'react-native'; | ||
|
||
import useStyles from '../utils/useStyles'; | ||
|
||
// This component is used to pass it to registerRootComponent(...) for Expo SDK | ||
// Otherwise, it was causing a crash on iOS (14?) in release build | ||
|
||
const ExpoApp: React.FC = () => { | ||
const { styles } = useStyles(_styles); | ||
|
||
return <View style={styles.container} />; | ||
} | ||
|
||
const _styles = (theme: ThemeType) => StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: theme.colors.bg, | ||
} | ||
}); | ||
|
||
export default ExpoApp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React from 'react'; | ||
import { | ||
SafeAreaView, | ||
Text, | ||
View, | ||
StyleSheet, | ||
} from 'react-native'; | ||
import { observer } from 'mobx-react'; | ||
import { NavigationFunctionComponent } from 'react-native-navigation'; | ||
|
||
import { useStores } from '../stores'; | ||
import { useServices } from '../services'; | ||
import Constants from '../utils/constants'; | ||
import useStyles from '../utils/useStyles'; | ||
|
||
// This is an example that can be used to bootstrap your new screen | ||
// Once you add a new screen, don't forget to go through following steps: | ||
// 1. Open src/utils/constants.ts and add a new screen's name to ScreenNames, and ScreenTitle (if going to use) | ||
// 2. Open stc/App.tsx and register a new screen | ||
|
||
const ExampleScreen: NavigationFunctionComponent = observer(({ | ||
componentId, | ||
}) => { | ||
const { } = useStores(); | ||
const { } = useServices(); | ||
const { styles } = useStyles(_styles); | ||
|
||
return ( | ||
<SafeAreaView style={styles.container}> | ||
<View style={styles.counterContainer}> | ||
<Text style={styles.text}> | ||
{ 'Example' } | ||
</Text> | ||
</View> | ||
</SafeAreaView> | ||
); | ||
}); | ||
|
||
const _styles = (theme: ThemeType) => StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
backgroundColor: theme.colors.bg, | ||
}, | ||
counterContainer: { | ||
padding: theme.sizes.s, | ||
flexDirection: 'row', | ||
width: '80%', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}, | ||
text: { | ||
fontSize: 64, | ||
margin: theme.sizes.s, | ||
textAlign: 'center', | ||
color: theme.colors.text, | ||
}, | ||
}); | ||
|
||
ExampleScreen.options = props => ({ | ||
topBar: { | ||
title: { | ||
text: Constants.ScreenTitles.ExampleScreen, | ||
}, | ||
}, | ||
}); | ||
|
||
export default ExampleScreen; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
import { observable, action, makeObservable } from 'mobx'; | ||
import { persist } from 'mobx-persist'; | ||
|
||
import { generateTheme } from '../utils/useStyles'; | ||
|
||
class UIStore implements IStore { | ||
STORAGE_ID = 'UIStore'; | ||
constructor() { makeObservable(this) } | ||
|
||
@observable networkType: string | undefined = ''; | ||
@observable theme = generateTheme(); // current theme, set in services.darkmode | ||
@observable componentId: string = ''; // current component id | ||
|
||
@action setNetworkType = (value: string | undefined) => this.networkType = value; | ||
@action setComponentId = (value: string) => this.componentId = value; | ||
|
||
@action toggleThemeTo = (theme: ThemeType) => { | ||
this.theme = theme; | ||
} | ||
} | ||
|
||
export default new UIStore(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters