Browse Source

home navigation

pull/8/head
Tim Glasgow 2 years ago
parent
commit
05252b83a9
  1. 15
      squarenotsquare/src/screens/Home.js

15
squarenotsquare/src/screens/Home.js

@ -1,19 +1,25 @@
import React, { useEffect } from "react";
import { BackHandler, Text, TouchableOpacity, View } from "react-native";
import { useState } from "react";
import { styles } from './styles/AppStyles';
import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons';
import Icons from '../themes/Icons';
import Colors from "../themes/Colors";
import Metrics from "../themes/Metrics";
import Slider from "../components/Slider";
import { useDispatch } from "react-redux";
import {squareStartPressed} from '../redux/actions/UserActions';
function Home(props){
function Home(){
const dispatch = useDispatch();
useEffect(() => {
BackHandler.addEventListener('hardwareBackPress', () => {return true});
}, [])
function onPressStart(){
dispatch(squareStartPressed());
}
return (
<View style={[styles.flex]}>
<TouchableOpacity style={[styles.absolute]}>
@ -37,7 +43,10 @@ function Home(props){
</View>
<View style={[styles.flex, styles.centeredItems, styles.spaceEvenly]}>
<Slider origin={400} duration={750} delay={0}>
<TouchableOpacity style={[styles.centeredJustify, styles.darkGreen, styles.menuButton, styles.dropShadow]}>
<TouchableOpacity
onPress={onPressStart}
style={[styles.centeredJustify, styles.darkGreen, styles.menuButton, styles.dropShadow]}
>
<Text style={[styles.lightText, styles.headerTitleFont, styles.boldText, styles.centeredText]}>
Start
</Text>

Loading…
Cancel
Save