From aed58f8749e3f2dbccb11ed80322aaba5caa6e6c Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Sun, 9 May 2021 15:11:01 +0200 Subject: [PATCH] Re-add link to game --- src/components/Tabbar/TabHomeIcon.tsx | 4 ++++ src/screens/Game/screens/GameStartScreen.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Tabbar/TabHomeIcon.tsx b/src/components/Tabbar/TabHomeIcon.tsx index a5e41d5..e7b40e5 100644 --- a/src/components/Tabbar/TabHomeIcon.tsx +++ b/src/components/Tabbar/TabHomeIcon.tsx @@ -2,6 +2,8 @@ import React from 'react'; import { View, StyleSheet, Image } from 'react-native'; import { FAB } from 'react-native-paper'; import * as Animatable from 'react-native-animatable'; +import { useNavigation } from '@react-navigation/core'; +import { MainRoutes } from '../../navigation/MainNavigator'; interface Props { icon: string; @@ -74,6 +76,7 @@ const FOCUSED_ICON = require('../../../assets/tab-icon.png'); const UNFOCUSED_ICON = require('../../../assets/tab-icon-outline.png'); function TabHomeIcon(props: Props) { + const navigation = useNavigation(); const getImage = (iconProps: { size: number; color: string }) => { return ( @@ -101,6 +104,7 @@ function TabHomeIcon(props: Props) { > navigation.navigate(MainRoutes.GameStart)} animated={false} icon={getImage} color={'#fff'} diff --git a/src/screens/Game/screens/GameStartScreen.tsx b/src/screens/Game/screens/GameStartScreen.tsx index bcb7480..7ac4e0d 100644 --- a/src/screens/Game/screens/GameStartScreen.tsx +++ b/src/screens/Game/screens/GameStartScreen.tsx @@ -469,7 +469,7 @@ class GameStartScreen extends React.Component { start={{ x: 0, y: 0 }} end={{ x: 0, y: 1 }} > - + {this.getMainContent()}