-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: upgrade to expo sdk 48 (#19)
* refactor: upgrade to expo sdk 48 * refactor: upgrade dependencies to latest * refactor: replace app-loading with splash-screen * refactor: prefer `useFonts` from expo-font * refactor: move away from `React.FC` * fix: crash when no locations are stored * chore: setup eas project id * chore: drop owner from app.json * chore: regenerate `eas.json` with m1 workers
- Loading branch information
Showing
15 changed files
with
2,723 additions
and
3,227 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
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,5 @@ | ||
import { registerRootComponent } from 'expo'; | ||
|
||
import { App } from './src/app'; | ||
|
||
registerRootComponent(App); |
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,13 +1,13 @@ | ||
import React from 'react'; | ||
|
||
import { AssetProvider } from './providers/asset'; | ||
import { NavigationProvider } from './providers/navigation'; | ||
import { ThemeProvider } from './providers/theme'; | ||
|
||
export const App: React.FC = () => ( | ||
<AssetProvider> | ||
<ThemeProvider> | ||
<NavigationProvider /> | ||
</ThemeProvider> | ||
</AssetProvider> | ||
); | ||
export function App() { | ||
return ( | ||
<AssetProvider> | ||
<ThemeProvider> | ||
<NavigationProvider /> | ||
</ThemeProvider> | ||
</AssetProvider> | ||
); | ||
} |
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,14 +1,20 @@ | ||
import { useFonts, OpenSans_600SemiBold, OpenSans_400Regular } from '@expo-google-fonts/open-sans'; | ||
import AppLoading from 'expo-app-loading'; | ||
import React from 'react'; | ||
import { OpenSans_600SemiBold, OpenSans_400Regular } from '@expo-google-fonts/open-sans'; | ||
import { useFonts } from 'expo-font'; | ||
import * as SplashScreen from 'expo-splash-screen'; | ||
import { useEffect, PropsWithChildren } from 'react'; | ||
|
||
export const AssetProvider: React.FC = (props) => { | ||
// Prevent the splash screen from hiding automatically | ||
SplashScreen.preventAutoHideAsync(); | ||
|
||
export function AssetProvider(props: PropsWithChildren) { | ||
const [isLoaded] = useFonts({ | ||
'open-sans-regular': OpenSans_400Regular, | ||
'open-sans-semibold': OpenSans_600SemiBold, | ||
}); | ||
|
||
return isLoaded | ||
? <>{props.children}</> | ||
: <AppLoading />; | ||
useEffect(() => { | ||
if (isLoaded) SplashScreen.hideAsync(); | ||
}, [isLoaded]); | ||
|
||
return !isLoaded ? null : <>{props.children}</>; | ||
}; |
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
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
Oops, something went wrong.