FIX: chhangement fonctionnement nav + image BotBar

stub-api
Alban GUILHOT 3 years ago
parent 29f946fe60
commit a7ed13445f

@ -4,32 +4,55 @@ import React from "react"
import styles from './style/BotBar.style'; import styles from './style/BotBar.style';
const gamepad = require('../../assets/Icons/Selected/SGamepad.png'); const gamepad = require('../../assets/Icons/UnSelected/Gamepad.png');
const message = require('../../assets/Icons/UnSelected/Chat.png'); const message = require('../../assets/Icons/UnSelected/Chat.png');
const store = require('../../assets/Icons/UnSelected/Store.png'); const store = require('../../assets/Icons/UnSelected/Store.png');
const sgamepad = require('../../assets/Icons/Selected/SGamepad.png');
const smessage = require('../../assets/Icons/Selected/SChat.png');
const sstore = require('../../assets/Icons/Selected/SStore.png');
export const BotBar : export const BotBar :
FC<{messages:ImageSourcePropType, games: ImageSourcePropType, shop: ImageSourcePropType, nav: any}> = FC<{nav: any, state?: String }> =
({nav}) => ({nav, state}) =>
{ {
var imgLeft=message, imgMid=gamepad, imgRight=store
console.log(state)
switch (state) {
case 'Home':
imgMid = sgamepad
break;
case 'Chat':
imgLeft = smessage
break;
case 'Store':
imgRight = sstore
break;
default:
break;
}
return ( return (
<View style={styles.footer}> <View style={styles.footer}>
<Pressable onPress={() => nav.navigate('ChatTab')}> <Pressable onPress={() => nav.navigate('ChatTab')}>
<Image <Image
style={styles.icon} style={styles.icon}
source={message} source={imgLeft}
/> />
</Pressable> </Pressable>
<Pressable onPress={()=> nav.navigate('HomeTab')}> <Pressable onPress={()=> nav.navigate('HomeTab')}>
<Image <Image
style={styles.icon} style={styles.icon}
source={gamepad} source={imgMid}
/> />
</Pressable> </Pressable>
<Pressable onPress={() => nav.navigate('StoreTab')}> <Pressable onPress={() => nav.navigate('StoreTab')}>
<Image <Image
style={styles.icon} style={styles.icon}
source={store} source={imgRight}
/> />
</Pressable> </Pressable>
</View> </View>

@ -1,13 +1,6 @@
import { StyleSheet } from 'react-native'; import { StyleSheet } from 'react-native';
export default StyleSheet.create({ export default StyleSheet.create({
text: {
fontSize: 16,
lineHeight: 21,
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
footer: { footer: {
flex: 0.15, flex: 0.15,
flexDirection: 'row', flexDirection: 'row',

Loading…
Cancel
Save