diff --git a/.eslintrc b/.eslintrc index 10571ba..8a9bd5b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -24,7 +24,8 @@ "react-native/no-raw-text": 2, "react-native/sort-styles": 2, "immutable/no-mutation": 0, - "react/jsx-indent": 0 + "react/jsx-indent": 0, + "react/jsx-props-no-spreading": 0 }, "globals": { "__DEV__": true, diff --git a/package-lock.json b/package-lock.json index 842885e..541af72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5418,13 +5418,10 @@ "resolved": "https://registry.npmjs.org/@react-native-community/cli-types/-/cli-types-3.0.0.tgz", "integrity": "sha512-ng6Tm537E/M42GjE4TRUxQyL8sRfClcL7bQWblOCoxPZzJ2J3bdALsjeG3vDnVCIfI/R0AeFalN9KjMt0+Z/Zg==" }, - "@react-navigation/compat": { - "version": "5.0.0-alpha.26", - "resolved": "https://registry.npmjs.org/@react-navigation/compat/-/compat-5.0.0-alpha.26.tgz", - "integrity": "sha512-sUXJIi0vizaeQMSkWzTXvV+rfUVtnWMxj8BT1Rbpo8fjyB4trQMt0KKZ6bXeVS7J/5ktv8AHe2H1YD8taZp9wQ==", - "requires": { - "@react-navigation/routers": "^5.0.0-alpha.25" - } + "@react-native-community/masked-view": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@react-native-community/masked-view/-/masked-view-0.1.5.tgz", + "integrity": "sha512-Lj1DzfCmW0f4HnmHtEuX8Yy2f7cnUA8r5KGGUuDDGtQt1so6QJkKeUmsnLo2zYDtsF8due6hvIL06Vdo5xxuLQ==" }, "@react-navigation/native": { "version": "5.0.0-alpha.27", @@ -5479,6 +5476,16 @@ } } }, + "@react-navigation/stack": { + "version": "5.0.0-alpha.58", + "resolved": "https://registry.npmjs.org/@react-navigation/stack/-/stack-5.0.0-alpha.58.tgz", + "integrity": "sha512-oHwG5D6dZLoB7jZBxlKuIzXaNcFTwnyL948UNbQaNBBLj1umW3B9Wn3ekoRUhBY40P/wcCQkGnUARTzH1c1dhw==", + "requires": { + "@react-navigation/routers": "^5.0.0-alpha.22", + "color": "^3.1.2", + "react-native-iphone-x-helper": "^1.2.1" + } + }, "@samverschueren/stream-to-observable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz", @@ -7024,6 +7031,15 @@ "object-visit": "^1.0.0" } }, + "color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/color/-/color-3.1.2.tgz", + "integrity": "sha512-vXTJhHebByxZn3lDvDJYw4lR5+uB3vuoHsuYA5AKuxRVn5wzzIfQKGLBmgdVRHKTJYeK5rvJcHnrd0Li49CFpg==", + "requires": { + "color-convert": "^1.9.1", + "color-string": "^1.5.2" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -7037,6 +7053,15 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, + "color-string": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz", + "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "color-support": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", @@ -16434,6 +16459,11 @@ } } }, + "react-native-iphone-x-helper": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.2.1.tgz", + "integrity": "sha512-/VbpIEp8tSNNHIvstuA3Swx610whci1Zpc9mqNkqn14DkMbw+ORviln2u0XyHG1kPvvwTNGZY6QpeFwxYaSdbQ==" + }, "react-native-platform-touchable": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/react-native-platform-touchable/-/react-native-platform-touchable-1.1.1.tgz", @@ -17103,6 +17133,21 @@ "plist": "^3.0.1" } }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "requires": { + "is-arrayish": "^0.3.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + } + } + }, "sisteransi": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.4.tgz", diff --git a/package.json b/package.json index 52dfd91..0a513a9 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,9 @@ }, "dependencies": { "@expo/vector-icons": "^10.0.6", - "@react-navigation/compat": "^5.0.0-alpha.26", + "@react-native-community/masked-view": "0.1.5", "@react-navigation/native": "^5.0.0-alpha.27", + "@react-navigation/stack": "^5.0.0-alpha.58", "axios": "^0.19.1", "expo": "^36.0.2", "expo-asset": "~8.0.0", @@ -63,13 +64,13 @@ "react-native-animatable": "^1.3.3", "react-native-gesture-handler": "~1.5.0", "react-native-platform-touchable": "^1.1.1", + "react-native-reanimated": "~1.4.0", + "react-native-safe-area-context": "0.6.0", + "react-native-screens": "2.0.0-alpha.12", "react-redux": "^7.1.3", "redux": "^4.0.5", "redux-axios-middleware": "^4.0.1", "redux-logger": "^3.0.6", - "redux-thunk": "^2.3.0", - "react-native-reanimated": "~1.4.0", - "react-native-screens": "2.0.0-alpha.12", - "react-native-safe-area-context": "0.6.0" + "redux-thunk": "^2.3.0" } } diff --git a/src/components/App.js b/src/components/App.js index 7c93636..5248f8d 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -1,8 +1,9 @@ import React, { useState, useEffect } from 'react'; +import { StatusBar } from 'react-native'; import { connect } from 'react-redux'; import { SafeAreaView } from './common/Layout'; import RootNavigator from '../navigation/RootNavigator'; -import Landing from './screens/Landing'; +import Splash from './screens/Splash'; import init from '../store/actions/common'; const App = ({ dispatch }) => { @@ -13,7 +14,12 @@ const App = ({ dispatch }) => { }, []); return ( - {isAppReady ? : } + + <> + + {isAppReady ? : } + + ); }; diff --git a/src/components/common/Camera.js b/src/components/common/Camera.js deleted file mode 100644 index 8be9383..0000000 --- a/src/components/common/Camera.js +++ /dev/null @@ -1,87 +0,0 @@ -import React, { Component } from 'react'; -import { StyleSheet, Text, View, TouchableOpacity } from 'react-native'; -import * as Permissions from 'expo-permissions'; -import { Camera as ExpoCamera } from 'expo-camera'; - -import { IonIcon } from './Icon'; -import { colors } from './theme'; - -const styles = StyleSheet.create({ - align: { - alignItems: 'center', - alignSelf: 'flex-end', - }, - row: { - backgroundColor: 'transparent', - flex: 1, - flexDirection: 'row', - }, -}); - -export default class Camera extends Component { - state = { - hasCameraPermission: null, - type: ExpoCamera.Constants.Type.back, - }; - - async componentWillMount() { - const { status } = await Permissions.askAsync(Permissions.CAMERA); - this.setState({ hasCameraPermission: status === 'granted' }); - } - - rotateCamera = () => { - this.setState({ - type: - this.state.type === ExpoCamera.Constants.Type.back - ? ExpoCamera.Constants.Type.front - : ExpoCamera.Constants.Type.back, - }); - }; - - render() { - const { hasCameraPermission } = this.state; - if (hasCameraPermission === null) { - return ; - } else if (hasCameraPermission === false) { - return No access to camera; - } - return ( - - { - this.camera = ref; - }} - > - - this.rotateCamera()} - > - - - { - if (this.camera) { - await this.camera.takePictureAsync(); - } - }} - > - - - - - - ); - } -} diff --git a/src/components/screens/Landing/index.js b/src/components/screens/Splash/index.js similarity index 100% rename from src/components/screens/Landing/index.js rename to src/components/screens/Splash/index.js diff --git a/src/navigation/Home/index.js b/src/navigation/Home/index.js index bd2c37e..a2a4a96 100644 --- a/src/navigation/Home/index.js +++ b/src/navigation/Home/index.js @@ -2,14 +2,13 @@ import React from 'react'; import { Platform } from 'react-native'; import { createStackNavigator } from '@react-navigation/stack'; import Icon from '../../components/common/Icon'; - import HomeScreen from '../../components/screens/Home'; -const HomeNavigator = createStackNavigator({ - Home: { - screen: HomeScreen, - navigationOptions: { - headerTitle: 'Home', +const Stack = createStackNavigator(); + +const HomeNavigator = () => ( + + + +); const HomeIcon = { tabBarIcon: ({ tintColor }) => ( diff --git a/src/navigation/RootNavigator.js b/src/navigation/RootNavigator.js index 5019379..872fe40 100644 --- a/src/navigation/RootNavigator.js +++ b/src/navigation/RootNavigator.js @@ -1,12 +1,25 @@ -import { - createAppContainer, - createBottomTabNavigator, - createStackNavigator, -} from '@react-navigation/stack'; +import React from 'react'; +import { NavigationNativeContainer } from '@react-navigation/native'; +import { createStackNavigator } from '@react-navigation/stack'; import { HomeNavigator, HomeIcon } from './Home'; import { colors } from '../components/common/theme'; -const TabBarNavigator = createBottomTabNavigator( +const Stack = createStackNavigator(); + +const RootNavigator = () => ( + + + + + +); + +/* const TabBarNavigator = createBottomTabNavigator( { Home: { screen: HomeNavigator }, }, @@ -54,6 +67,6 @@ const RootNavigator = createAppContainer( }, } ) -); +); */ export default RootNavigator;