As we saw before, only logged-in users can complete purchases so we need a way for the users to log in, log out, register, and review their account details. This will be achieved by the MyProfile screen and the <LonginOrRegister /> component:
/*** src/screens/MyProfile.js ***/
import React from 'react';
import { View, Button as LinkButton } from 'react-native';
import PropTypes from 'prop-types';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import {
Icon,
Header,
Title,
Label,
Input,
Item,
Form,
Content,
} from 'native-base';
import * as UserActions from '../reducers/user';
import LoginOrRegister from '../components/LoginOrRegister';
class MyProfile extends React.Component {
static navigationOptions = {
drawerLabel: 'My Profile',
...