Skip to content

Instantly share code, notes, and snippets.

View linux08's full-sized avatar
📚
Learning.

David Abimbola linux08

📚
Learning.
View GitHub Profile
import React from 'react';
import {
AsyncStorage,
Button,
StatusBar,
StyleSheet,
View,
Text,
} from 'react-native';
import { MyContext } from '../Provider';
import React from 'react';
import {
ActivityIndicator,
AsyncStorage,
StatusBar,
StyleSheet,
View,
} from 'react-native';
import { MyContext } from '../Provider';
import React from 'react';
import { StyleSheet, View, Text } from 'react-native';
import { AppNavigator} from './navigator';
import MyProvider from './Provider';
export default () => (
<MyProvider>
<View style={styles.container}>
<AppNavigator />
import React, { Component } from 'react';
import { AsyncStorage } from 'react-native';
export const MyContext = React.createContext();
export default class MyProvider extends Component {
state = {
token: '',
saveToken: async () => {
import React from 'react';
import {
AsyncStorage,
Button,
StatusBar,
StyleSheet,
View,
Text,
} from 'react-native';
import React from 'react';
import {
ActivityIndicator,
AsyncStorage,
StatusBar,
StyleSheet,
View,
} from 'react-native';
import { connect } from 'react-redux';
import { getUserToken } from '../actions';
import { combineReducers } from 'redux';
const rootReducer = (state = {
token: {},
loading: true,
error: null,
}, action) => {
switch (action.type) {
case 'GET_TOKEN':
import { AsyncStorage } from 'react-native';
export const getToken = (token) => ({
type: 'GET_TOKEN',
token,
});
export const saveToken = token => ({
type: 'SAVE_TOKEN',
<MapView
ref={c => this.mapView = c}
style={{
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
}}
provider="google"
import React from 'react';
import { View, Text, TouchableOpacity, TextInput, TouchableWithoutFeedback, Keyboard, Animated, Image } from 'react-native';
// import { connect } from 'react-redux';
import Spinner from '../components/Spinner';
import * as API from '../utils/api';
class EnterCode extends React.Component {
static navigationOptions = {
title: 'Enter Code',
headerTintColor: 'black',