stub-api
Mathilde Jean 3 years ago
commit 2b97b715c5

@ -0,0 +1,32 @@
import { FC, ReactNode } from "react"
import { Pressable, Image, ImageStyle, Text, View, Alert, ImageSourcePropType, TextStyle } from "react-native"
import React from "react"
export const BotBar :
FC<{messages:ImageSourcePropType, games: ImageSourcePropType, shop: ImageSourcePropType, style: ImageStyle, nav: any, styleBar : any}> =
({messages, games, shop,style, nav,styleBar}) =>
{
return (
<View style={styleBar}>
<Pressable onPress={() => nav.navigate('ChatTab')}>
<Image
style={style}
source={messages}
/>
</Pressable>
<Pressable onPress={()=> nav.navigate('HomeTab')}>
<Image
style={style}
source={games}
/>
</Pressable>
<Pressable onPress={() => nav.navigate('StoreTab')}>
<Image
style={style}
source={shop}
/>
</Pressable>
</View>
)
}

@ -0,0 +1,23 @@
import { FC, ReactNode } from "react"
import { Pressable, Image, ImageStyle, Text, View, Alert, ImageSourcePropType, TextStyle } from "react-native"
import { Skin } from "../core/Skin"
import React from "react"
import { SkinComponent } from "./skinAvatar"
import MainTabNavigator from "../navigation/AppNavigator"
import { BottomTabNavigationProp } from "@react-navigation/bottom-tabs"
export const TopBar : FC<{skin: Skin, styleAvatar: ImageStyle, title: String, rightIcon: ImageSourcePropType, styleIcon: ImageStyle,nav: any, styleTitle: TextStyle, styleHeader : any}> = ({skin, styleAvatar, title, rightIcon,styleIcon, nav, styleTitle, styleHeader}) =>
{
return (
<View style={styleHeader}>
<Pressable onPress={() => nav.navigate('ProfileTab')}>
<SkinComponent skin={skin} children={styleAvatar} />
</Pressable>
<Text style={styleTitle}>{title}</Text>
<Pressable onPress={() => nav.navigate('Settings')}>
<Image source={rightIcon} style={styleIcon}/>
</Pressable>
</View>
)
}

@ -4,8 +4,6 @@ import { Skin } from "../core/Skin"
import React from "react" import React from "react"
export const SkinComponent : FC<{skin: Skin, children: ImageStyle}> = ({skin, children}) => { export const SkinComponent : FC<{skin: Skin, children: ImageStyle}> = ({skin, children}) => {
console.log(skin.getSkinSource());
return ( return (
<View> <View>
<Image source={ skin.getSkinSource()} style={children}/> <Image source={ skin.getSkinSource()} style={children}/>

@ -0,0 +1,24 @@
import { Message } from "./message"
import { User } from "./user";
export class conversation{
private TabUser?: User[];
private TabMessage?: Message[];
constructor(tabUser: User[], tabMessage:Message[]){
this.TabUser=[...tabUser];
this.TabMessage=[...tabMessage];
}
getTabMessage(){
return this.TabMessage;
}
getTabUser(){
return this.TabUser;
}
}

@ -0,0 +1,40 @@
import { User } from './user'
export class Message{
private Content: string;
private Sender: User;
private DateEnvoie: Date;
constructor(content: string, sender:User, dateEnvoie:Date){
this.Content=content;
this.Sender=sender;
this.DateEnvoie=dateEnvoie;
}
setMessageContent(content: string){
this.Content=content;
}
setSMessageSender(sender: User){
this.Sender=sender;
}
setSMessageDate(dateEnvoie: Date){
this.DateEnvoie=dateEnvoie;
}
getMessageContent(){
return this.Content;
}
getMessageSender(){
return this.Sender;
}
getMessageDate(){
return this.DateEnvoie;
}
}

@ -1,5 +1,3 @@
import { ImageURISource } from "react-native";
export class Skin{ export class Skin{
private Name: string; private Name: string;
private Source: any; private Source: any;

@ -21,7 +21,7 @@ export class User{
this.CurrentCoins=currentCoins; this.CurrentCoins=currentCoins;
this.TotalCoins=totalCoins; this.TotalCoins=totalCoins;
this.CurrentSkin=currentSkin; this.CurrentSkin=currentSkin;
this.TabSkin=tabSkin; this.TabSkin=[...tabSkin];
} }
getUsername(){ getUsername(){
@ -93,6 +93,6 @@ export class User{
} }
setTabSkin(tabSkin: Skin[]){ setTabSkin(tabSkin: Skin[]){
this.TabSkin=tabSkin; this.TabSkin=[...tabSkin];
} }
} }

@ -67,10 +67,10 @@ function MainTabNavigator() {
backBehavior='none' backBehavior='none'
screenOptions={{headerShown: false, tabBarStyle: { display: 'none' },}} screenOptions={{headerShown: false, tabBarStyle: { display: 'none' },}}
> >
<Tab.Screen name='Home' component={HomeStackScreen} /> <Tab.Screen name='HomeTab' component={HomeStackScreen} />
<Tab.Screen name='Store' component={StoreStackScreen} /> <Tab.Screen name='StoreTab' component={StoreStackScreen} />
<Tab.Screen name='Chat' component={ChatStackScreen} /> <Tab.Screen name='ChatTab' component={ChatStackScreen} />
<Tab.Screen name='Profile' component={Profile} /> <Tab.Screen name='ProfileTab' component={ProfileStackScreen} />
<Tab.Screen name='Test' component={Test} /> <Tab.Screen name='Test' component={Test} />
</Tab.Navigator> </Tab.Navigator>
</NavigationContainer> </NavigationContainer>

@ -1,32 +1,29 @@
import { StatusBar } from 'expo-status-bar' import { StatusBar } from 'expo-status-bar'
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native' import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
import React from 'react'; import React from 'react';
import { Skin } from '../core/skin';
import { TopBar } from '../components/TopBar';
import { BotBar } from '../components/BotBar';
const avatar = require('../../assets/Icons/BobClassic.png'); const avatar = require('../../assets/Icons/BobClassic.png');
const skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png'));
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png'); const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
const gamepad = require('../../assets/Icons/UnSelected/Gamepad.png'); const gamepad = require('../../assets/Icons/UnSelected/Gamepad.png');
const message = require('../../assets/Icons/Selected/SChat.png'); const message = require('../../assets/Icons/Selected/SChat.png');
const store = require('../../assets/Icons/UnSelected/Store.png'); const store = require('../../assets/Icons/UnSelected/Store.png');
function Store(props: { navigation: any; }) { function Chat(props: { navigation: any; }) {
const { navigation } = props const { navigation } = props
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <TopBar
<Pressable onPress={() => navigation.navigate('Profile')}> skin={skinTest}
<Image styleAvatar={styles.avatar}
style={styles.avatar} title="BOB PARTY"
source={avatar} rightIcon={engrenage}
/> styleIcon={styles.engrenage}
</Pressable> nav={navigation} styleTitle={styles.titre} styleHeader={styles.header}
<Text style={styles.titre}>BOB PARTY</Text>
<Pressable onPress={() => navigation.navigate('Settings')}>
<Image
style={styles.engrenage}
source={engrenage}
/> />
</Pressable>
</View>
<View style={styles.body}> <View style={styles.body}>
<Text style={styles.text}>couille</Text> <Text style={styles.text}>couille</Text>
</View> </View>
@ -37,13 +34,13 @@ function Store(props: { navigation: any; }) {
source={message} source={message}
/> />
</Pressable> </Pressable>
<Pressable onPress={() => navigation.navigate('Home')}> <Pressable onPress={() => navigation.navigate('HomeTab')}>
<Image <Image
style={styles.iconFooter} style={styles.iconFooter}
source={gamepad} source={gamepad}
/> />
</Pressable> </Pressable>
<Pressable onPress={() => navigation.navigate('Store')}> <Pressable onPress={() => navigation.navigate('StoreTab')}>
<Image <Image
style={styles.iconStore} style={styles.iconStore}
source={store} source={store}
@ -153,4 +150,4 @@ const styles = StyleSheet.create({
}); });
export default Store export default Chat

@ -1,34 +1,41 @@
import { StatusBar } from 'expo-status-bar' import { StatusBar } from 'expo-status-bar'
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native' import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
import React from 'react'; import React, { Children } from 'react';
import { SkinComponent } from '../components/skinAvatar'; import { SkinComponent } from '../components/skinAvatar';
import { User } from '../core/user'; import { User } from '../core/user';
import { Skin } from '../core/skin'; import { Skin } from '../core/skin';
import { TopBar } from '../components/TopBar';
import { BotBar } from '../components/BotBar';
const avatar = require('../../assets/Icons/BobClassic.png'); const avatar = require('../../assets/Icons/BobClassic.png');
let tabSkin:Skin[];
const skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png')); const skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png'));
const skinTest2= new Skin("wesh",require('../../assets/BobsSkins/BobBlue.png'));
tabSkin=[skinTest];
tabSkin.push(skinTest2);
const UserActu=new User("14", "leBg", "ouioui", "grand", "la", 12222, 123324, skinTest, tabSkin);
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png'); const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
const gamepad = require('../../assets/Icons/Selected/SGamepad.png'); const gamepad = require('../../assets/Icons/Selected/SGamepad.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');
function Home(props: { navigation: any; }) { function Home(props: { navigation: any; }) {
const { navigation } = props const { navigation } = props
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <TopBar
<Pressable onPress={() => navigation.navigate('Profile')}> skin={skinTest}
<SkinComponent skin={skinTest} children={styles.avatar} /> styleAvatar={styles.avatar}
</Pressable> title="BOB PARTY"
<Text style={styles.titre}>BOB PARTY</Text> rightIcon={engrenage}
<Pressable onPress={() => navigation.navigate('Settings')}> styleIcon={styles.engrenage}
<Image nav={navigation}
style={styles.engrenage} styleTitle={styles.titre}
source={engrenage} styleHeader={styles.header}
/> />
</Pressable>
</View>
<View style={styles.body}> <View style={styles.body}>
<Button <Button
title='Jouer Seul' title='Jouer Seul'
@ -39,26 +46,14 @@ function Home(props: { navigation: any; }) {
onPress={() => Alert.alert('On Joue avec les potos')} onPress={() => Alert.alert('On Joue avec les potos')}
/> />
</View> </View>
<View style={styles.footer}> <BotBar
<Pressable onPress={() => navigation.navigate('Chat')}> messages={message}
<Image games={gamepad}
style={styles.iconFooter} shop={store}
source={message}
/>
</Pressable>
<Pressable >
<Image
style={styles.iconFooter} style={styles.iconFooter}
source={gamepad} nav={navigation}
/> styleBar={styles.footer}
</Pressable> />
<Pressable onPress={() => navigation.navigate('Store')}>
<Image
style={styles.iconStore}
source={store}
/>
</Pressable>
</View>
</View> </View>
); );
} }

@ -1,49 +1,48 @@
import { StatusBar } from 'expo-status-bar' import { StatusBar } from 'expo-status-bar'
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native' import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
import React from 'react'; import React, { Children } from 'react';
import { SkinComponent } from '../components/skinAvatar';
import { User } from '../core/user';
import { Skin } from '../core/skin';
import { TopBar } from '../components/TopBar';
import { BotBar } from '../components/BotBar';
const avatar = require('../../assets/Icons/BobClassic.png'); const avatar = require('../../assets/Icons/BobClassic.png');
const skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png'));
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png'); const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
const gamepad = require('../../assets/Icons/UnSelected/Gamepad.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');
function Store(props: { navigation: any; }) { function Profile(props: { navigation: any; }) {
const { navigation } = props const { navigation } = props
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <TopBar
<Pressable> skin={skinTest}
<Image styleAvatar={styles.avatar}
style={styles.avatar} title="BOB PARTY"
source={avatar} rightIcon={engrenage}
/> styleIcon={styles.engrenage}
</Pressable> nav={navigation} styleTitle={styles.titre} styleHeader={styles.header}
<Text style={styles.titre}>BOB PARTY</Text>
<Pressable onPress={() => navigation.navigate('Settings')}>
<Image
style={styles.engrenage}
source={engrenage}
/> />
</Pressable>
</View>
<View style={styles.body}> <View style={styles.body}>
<Text style={styles.text}>couille</Text> <Text style={styles.text}>couille</Text>
</View> </View>
<View style={styles.footer}> <View style={styles.footer}>
<Pressable onPress={() => navigation.navigate('Chat')}> <Pressable onPress={() => navigation.navigate('ChatTab')}>
<Image <Image
style={styles.iconFooter} style={styles.iconFooter}
source={message} source={message}
/> />
</Pressable> </Pressable>
<Pressable onPress={() => navigation.navigate('Home')}> <Pressable onPress={() => navigation.navigate('HomeTab')}>
<Image <Image
style={styles.iconFooter} style={styles.iconFooter}
source={gamepad} source={gamepad}
/> />
</Pressable> </Pressable>
<Pressable onPress={() => navigation.navigate('Store')}> <Pressable onPress={() => navigation.navigate('StoreTab')}>
<Image <Image
style={styles.iconStore} style={styles.iconStore}
source={store} source={store}
@ -153,4 +152,4 @@ const styles = StyleSheet.create({
}); });
export default Store export default Profile

@ -1,8 +1,15 @@
import { StatusBar } from 'expo-status-bar' import { StatusBar } from 'expo-status-bar'
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native' import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
import React from 'react'; import React, { Children } from 'react';
import { SkinComponent } from '../components/skinAvatar';
import { User } from '../core/user';
import { Skin } from '../core/skin';
import { TopBar } from '../components/TopBar';
import { BotBar } from '../components/BotBar';
const avatar = require('../../assets/Icons/BobClassic.png'); const avatar = require('../../assets/Icons/BobClassic.png');
const skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png'));
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png'); const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
const gamepad = require('../../assets/Icons/UnSelected/Gamepad.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');
@ -12,44 +19,28 @@ function Store(props: { navigation: any; }) {
const { navigation } = props const { navigation } = props
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <TopBar
<Pressable onPress={() => navigation.navigate('Profile')}> skin={skinTest}
<Image styleAvatar={styles.avatar}
style={styles.avatar} title="BOB PARTY"
source={avatar} rightIcon={engrenage}
/> styleIcon={styles.engrenage}
</Pressable> nav={navigation} styleTitle={styles.titre} styleHeader={styles.header}
<Text style={styles.titre}>BOB PARTY</Text> />
<Pressable onPress={() => navigation.navigate('Settings')}> <View style={styles.body}>
<Image <Text style={styles.text}>couille</Text>
style={styles.engrenage}
source={engrenage}
/>
</Pressable>
</View> </View>
<View style={styles.body}> <View style={styles.body}>
<Text style={styles.text}>couille</Text> <Text style={styles.text}>couille</Text>
</View> </View>
<View style={styles.footer}> <BotBar
<Pressable onPress={() => navigation.navigate('Chat')}> messages={message}
<Image games={gamepad}
shop={store}
style={styles.iconFooter} style={styles.iconFooter}
source={message} nav={navigation}
/> styleBar={styles.footer}
</Pressable> />
<Pressable onPress={() => navigation.navigate('Home')}>
<Image
style={styles.iconFooter}
source={gamepad}
/>
</Pressable>
<Pressable >
<Image
style={styles.iconStore}
source={store}
/>
</Pressable>
</View>
</View> </View>
); );
} }

Loading…
Cancel
Save