diff --git a/bob_party/src/components/BotBar.tsx b/bob_party/src/components/BotBar.tsx new file mode 100644 index 0000000..a987169 --- /dev/null +++ b/bob_party/src/components/BotBar.tsx @@ -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 ( + + nav.navigate('ChatTab')}> + + + nav.navigate('HomeTab')}> + + + nav.navigate('StoreTab')}> + + + + ) +} \ No newline at end of file diff --git a/bob_party/src/components/TopBar.tsx b/bob_party/src/components/TopBar.tsx new file mode 100644 index 0000000..869443f --- /dev/null +++ b/bob_party/src/components/TopBar.tsx @@ -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 ( + + nav.navigate('ProfileTab')}> + + + {title} + nav.navigate('Settings')}> + + + + ) +} \ No newline at end of file diff --git a/bob_party/src/components/skinAvatar.tsx b/bob_party/src/components/skinAvatar.tsx index f0afef3..2e1eb8a 100644 --- a/bob_party/src/components/skinAvatar.tsx +++ b/bob_party/src/components/skinAvatar.tsx @@ -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 ( diff --git a/bob_party/src/core/conversation.ts b/bob_party/src/core/conversation.ts new file mode 100644 index 0000000..5101847 --- /dev/null +++ b/bob_party/src/core/conversation.ts @@ -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; + } + + +} + diff --git a/bob_party/src/core/message.ts b/bob_party/src/core/message.ts new file mode 100644 index 0000000..0327d5c --- /dev/null +++ b/bob_party/src/core/message.ts @@ -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; + } + + +} \ No newline at end of file diff --git a/bob_party/src/core/skin.ts b/bob_party/src/core/skin.ts index c41f2d9..6f6bfde 100644 --- a/bob_party/src/core/skin.ts +++ b/bob_party/src/core/skin.ts @@ -1,5 +1,3 @@ -import { ImageURISource } from "react-native"; - export class Skin{ private Name: string; private Source: any; diff --git a/bob_party/src/core/user.ts b/bob_party/src/core/user.ts index dcf268a..9c645de 100644 --- a/bob_party/src/core/user.ts +++ b/bob_party/src/core/user.ts @@ -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]; } } \ No newline at end of file diff --git a/bob_party/src/navigation/AppNavigator.tsx b/bob_party/src/navigation/AppNavigator.tsx index 1470d38..d5836c5 100644 --- a/bob_party/src/navigation/AppNavigator.tsx +++ b/bob_party/src/navigation/AppNavigator.tsx @@ -67,10 +67,10 @@ function MainTabNavigator() { backBehavior='none' screenOptions={{headerShown: false, tabBarStyle: { display: 'none' },}} > - - - - + + + + diff --git a/bob_party/src/screens/Chat.tsx b/bob_party/src/screens/Chat.tsx index c0cec66..a2b528e 100644 --- a/bob_party/src/screens/Chat.tsx +++ b/bob_party/src/screens/Chat.tsx @@ -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 ( - - navigation.navigate('Profile')}> - - - BOB PARTY - navigation.navigate('Settings')}> - - - couille @@ -37,13 +34,13 @@ function Store(props: { navigation: any; }) { source={message} /> - navigation.navigate('Home')}> + navigation.navigate('HomeTab')}> - navigation.navigate('Store')}> + navigation.navigate('StoreTab')}> - - navigation.navigate('Profile')}> - - - BOB PARTY - navigation.navigate('Settings')}> - - - +