Merge branch 'typescript' of https://codefirst.iut.uca.fr/git/BOB_PARTEAM/BOB_PARTY into typescript
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>
|
||||
)
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in new issue