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"
export const SkinComponent : FC<{skin: Skin, children: ImageStyle}> = ({skin, children}) => {
console.log(skin.getSkinSource());
return (
<View>
<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{
private Name: string;
private Source: any;

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

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

@ -1,32 +1,29 @@
import { StatusBar } from 'expo-status-bar'
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
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 skinTest= new Skin("Bob",require('../../assets/Icons/BobClassic.png'));
const engrenage = require('../../assets/Icons/UnSelected/Cogs.png');
const gamepad = require('../../assets/Icons/UnSelected/Gamepad.png');
const message = require('../../assets/Icons/Selected/SChat.png');
const store = require('../../assets/Icons/UnSelected/Store.png');
function Store(props: { navigation: any; }) {
function Chat(props: { navigation: any; }) {
const { navigation } = props
return (
<View style={styles.container}>
<View style={styles.header}>
<Pressable onPress={() => navigation.navigate('Profile')}>
<Image
style={styles.avatar}
source={avatar}
/>
</Pressable>
<Text style={styles.titre}>BOB PARTY</Text>
<Pressable onPress={() => navigation.navigate('Settings')}>
<Image
style={styles.engrenage}
source={engrenage}
<TopBar
skin={skinTest}
styleAvatar={styles.avatar}
title="BOB PARTY"
rightIcon={engrenage}
styleIcon={styles.engrenage}
nav={navigation} styleTitle={styles.titre} styleHeader={styles.header}
/>
</Pressable>
</View>
<View style={styles.body}>
<Text style={styles.text}>couille</Text>
</View>
@ -37,13 +34,13 @@ function Store(props: { navigation: any; }) {
source={message}
/>
</Pressable>
<Pressable onPress={() => navigation.navigate('Home')}>
<Pressable onPress={() => navigation.navigate('HomeTab')}>
<Image
style={styles.iconFooter}
source={gamepad}
/>
</Pressable>
<Pressable onPress={() => navigation.navigate('Store')}>
<Pressable onPress={() => navigation.navigate('StoreTab')}>
<Image
style={styles.iconStore}
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 { 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');
let tabSkin:Skin[];
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 gamepad = require('../../assets/Icons/Selected/SGamepad.png');
const message = require('../../assets/Icons/UnSelected/Chat.png');
const store = require('../../assets/Icons/UnSelected/Store.png');
function Home(props: { navigation: any; }) {
const { navigation } = props
return (
<View style={styles.container}>
<View style={styles.header}>
<Pressable onPress={() => navigation.navigate('Profile')}>
<SkinComponent skin={skinTest} children={styles.avatar} />
</Pressable>
<Text style={styles.titre}>BOB PARTY</Text>
<Pressable onPress={() => navigation.navigate('Settings')}>
<Image
style={styles.engrenage}
source={engrenage}
/>
</Pressable>
</View>
<TopBar
skin={skinTest}
styleAvatar={styles.avatar}
title="BOB PARTY"
rightIcon={engrenage}
styleIcon={styles.engrenage}
nav={navigation}
styleTitle={styles.titre}
styleHeader={styles.header}
/>
<View style={styles.body}>
<Button
title='Jouer Seul'
@ -39,26 +46,14 @@ function Home(props: { navigation: any; }) {
onPress={() => Alert.alert('On Joue avec les potos')}
/>
</View>
<View style={styles.footer}>
<Pressable onPress={() => navigation.navigate('Chat')}>
<Image
style={styles.iconFooter}
source={message}
/>
</Pressable>
<Pressable >
<Image
<BotBar
messages={message}
games={gamepad}
shop={store}
style={styles.iconFooter}
source={gamepad}
/>
</Pressable>
<Pressable onPress={() => navigation.navigate('Store')}>
<Image
style={styles.iconStore}
source={store}
/>
</Pressable>
</View>
nav={navigation}
styleBar={styles.footer}
/>
</View>
);
}

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

Loading…
Cancel
Save