import React from 'react';
import { StyleSheet } from 'react-native';
import Background from '../component/background';
import MainContent from '../component/main-content';
import { color } from '../component/style';
import PropTypes from 'prop-types';
import { Button, ButtonText } from '../component/button';
import { ContinuousLoadNetworkSpinner } from '../component/spinner';

const styles = StyleSheet.create({
  content: {
    justifyContent: 'center',
  },
  btn: {
    position: 'fixed',
    bottom: '0px',
  },
});

const WaitView = ({ nav }) => (
  <Background color={color.blackDark}>
    <MainContent style={styles.content}>
      <ContinuousLoadNetworkSpinner msg="Loading..." />
      <Button onPress={() => nav.goHome()} style={styles.btn}>
        <ButtonText>HOME</ButtonText>
      </Button>
    </MainContent>
  </Background>
);

WaitView.propTypes = {
  nav: PropTypes.object.isRequired,
};

export default WaitView;
