Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* @flow */
- import React, { Component } from 'react';
- import {
- View,
- Text,
- StyleSheet,
- } from 'react-native';
- import { Constants, Location, Permissions } from 'expo';
- import MainNavigator from '../navigation/MainNavigator';
- import AppInfo from '../components/AppInfo/AppInfo';
- import { MainStyle } from '../stylesheets/MainStyle';
- export default class GoHome extends Component {
- constructor(props){
- super(props);
- }
- static navigationOptions = {
- header: null,
- };
- componentWillMount(){
- this._getLocationAsync();
- }
- _getLocationAsync = async () => {
- let { status } = await Permissions.askAsync(Permissions.LOCATION);
- if (status !== 'granted') {
- console.log('Error - location access denied');
- }else{
- let location = await Location.getCurrentPositionAsync({});
- console.log(location);
- }
- }
- render() {
- return (
- <Image style = {MainStyle.imageContainer} source = {require('../assets/bg/bg_main.jpg')}>
- <AppInfo />
- <MainNavigator navigation = {this.props.navigation} />
- </Image>
- );
- }
- }
- const styles = StyleSheet.create({
- });
- GoHome.router = MainNavigator.router;
- /* @flow */
- import React, { Component } from 'react';
- import {
- View,
- Text,
- StyleSheet,
- Image
- } from 'react-native';
- import { StackNavigator } from 'react-navigation';
- import Register from '../components/Register/Register';
- import Password from '../components/Password/Password';
- import AppInfo from '../components/AppInfo/AppInfo';
- import { MainStyle } from '../stylesheets/MainStyle';
- import GoHome from '../screens/GoHome';
- const NavigatorMain = StackNavigator({
- Home: {
- screen: GoHome
- },
- Register: {
- screen: Register
- },
- Password: {
- screen: Password
- }
- });
- // export default class MainNavigator extends Component {
- // render() {
- // return (
- // <NavigatorMain />
- // );
- // }
- // }
- const styles = StyleSheet.create({
- });
- export default NavigatorMain;
Add Comment
Please, Sign In to add comment