diff --git a/squarenotsquare/src/screens/Home.js b/squarenotsquare/src/screens/Home.js index 1a0c55a..6193f73 100644 --- a/squarenotsquare/src/screens/Home.js +++ b/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 ( @@ -37,7 +43,10 @@ function Home(props){ - + Start