diff --git a/App.js b/App.js index 761adac..b9c9a2d 100644 --- a/App.js +++ b/App.js @@ -1,11 +1,16 @@ -import React from 'react'; -import { Image } from 'react-native'; -import { AppLoading } from 'expo'; -import { Asset } from 'expo-asset'; -import { Block, GalioProvider } from 'galio-framework'; +import React from "react"; +import { Image } from "react-native"; +import { AppLoading } from "expo"; +import { Asset } from "expo-asset"; +import { Block, GalioProvider } from "galio-framework"; +import { NavigationContainer } from "@react-navigation/native"; -import Screens from './navigation/Screens'; -import { Images, articles, argonTheme } from './constants'; +// Before rendering any navigation stack +import { enableScreens } from "react-native-screens"; +enableScreens(); + +import Screens from "./navigation/Screens"; +import { Images, articles, argonTheme } from "./constants"; // cache app images const assetImages = [ @@ -23,7 +28,7 @@ articles.map(article => assetImages.push(article.image)); function cacheImages(images) { return images.map(image => { - if (typeof image === 'string') { + if (typeof image === "string") { return Image.prefetch(image); } else { return Asset.fromModule(image).downloadAsync(); @@ -33,11 +38,11 @@ function cacheImages(images) { export default class App extends React.Component { state = { - isLoadingComplete: false, - } - + isLoadingComplete: false + }; + render() { - if(!this.state.isLoadingComplete) { + if (!this.state.isLoadingComplete) { return ( - - - - + + + + + + + ); } } _loadResourcesAsync = async () => { - return Promise.all([ - ...cacheImages(assetImages), - ]); + return Promise.all([...cacheImages(assetImages)]); }; _handleLoadingError = error => { @@ -71,5 +76,4 @@ export default class App extends React.Component { _handleFinishLoading = () => { this.setState({ isLoadingComplete: true }); }; - } diff --git a/components/Card.js b/components/Card.js index 276f79b..6b7bc89 100644 --- a/components/Card.js +++ b/components/Card.js @@ -1,5 +1,5 @@ import React from 'react'; -import { withNavigation } from 'react-navigation'; +import { withNavigation } from '@react-navigation/compat'; import PropTypes from 'prop-types'; import { StyleSheet, Dimensions, Image, TouchableWithoutFeedback } from 'react-native'; import { Block, Text, theme } from 'galio-framework'; diff --git a/components/Header.js b/components/Header.js index a4e4ccd..f15e028 100644 --- a/components/Header.js +++ b/components/Header.js @@ -1,5 +1,5 @@ import React from 'react'; -import { withNavigation } from 'react-navigation'; +import { withNavigation } from '@react-navigation/compat'; import { TouchableOpacity, StyleSheet, Platform, Dimensions } from 'react-native'; import { Button, Block, NavBar, Text, theme } from 'galio-framework'; diff --git a/navigation/Screens.js b/navigation/Screens.js index af7adcb..01306f1 100644 --- a/navigation/Screens.js +++ b/navigation/Screens.js @@ -131,7 +131,7 @@ export default function OnboardingStack(props) { navigation.navigate("Home")} + onPress={() => navigation.navigate("App")} textStyle={{ color: argonTheme.COLORS.BLACK }} > Get Started