Compare commits

...

11 Commits
master ... dev

@ -0,0 +1,6 @@
import React from 'react'
import MainTabNavigator from './src/navigation/AppNavigator'
export default function App() {
return <MainTabNavigator/>
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 1013 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,13 @@
import { FC, ReactNode } from "react"
import { Button, Image, Text, View } from "react-native"
import { Skin } from "../core/Skin"
/*
export const SkinComponent : FC<{skin: Skin, children: ReactNode}> = ({skin, children}) => {
return <View>
<Image source={{uri: skin.source}}/>
<Text>{t}</Text>
</View>
}
*/

@ -0,0 +1,25 @@
export class Skin{
private Name: string;
private Source: string;
constructor(name: string, source:string){
this.Name=name;
this.Source=source;
}
setSkinName(name: string){
this.Name=name;
}
setSkinSource(source: string){
this.Source=source;
}
getSkinSource(){
return this.Source;
}
getSkinName(){
return this.Name;
}
}

@ -0,0 +1,98 @@
import { Skin } from './Skin'
export class User{
private Id: string;
private Username: string;
private Nationality: string;
private Sexe: string;
private DateOfBirth: string;
private CurrentCoins: number;
private TotalCoins: number;
private CurrentSkin: Skin;
private TabSkin: Skin[];
constructor(id: string, username: string, nationality: string, sexe: string, dateOfBirth: string, currentCoins: number, totalCoins: number,
currentSkin: Skin, tabSkin: Skin[] ){
this.Id=id;
this.Username=username;
this.Nationality=nationality;
this.Sexe=sexe;
this.DateOfBirth=dateOfBirth;
this.CurrentCoins=currentCoins;
this.TotalCoins=totalCoins;
this.CurrentSkin=currentSkin;
this.TabSkin=tabSkin;
}
getUsername(){
return this.Username;
}
setUsername(username: string){
this.Username=username;
}
getId(){
return this.Id;
}
setId(id: string){
this.Id=id;
}
getCurrentCoins(){
return this.CurrentCoins;
}
setCurrentCoins(currentCoins: number){
this.CurrentCoins=currentCoins;
}
getSexe(){
return this.Sexe;
}
setSexe(sexe: string){
this.Sexe=sexe;
}
getDateOfBirth(){
return this.DateOfBirth;
}
setDateOfBirth(dateOfBirth: string){
this.DateOfBirth=dateOfBirth;
}
getNationality(){
return this.Nationality;
}
setNationality(nationality: string){
this.Nationality=nationality;
}
getTotalCoins(){
return this.TotalCoins;
}
setTotalCoins(totalCoins: number){
this.TotalCoins=totalCoins;
}
getCurrentSkin(){
return this.CurrentSkin;
}
setCurrentSkin(newSkin: Skin){
this.CurrentSkin=newSkin;
}
getTabSkin(){
return this.TabSkin;
}
setTabSkin(tabSkin: Skin[]){
this.TabSkin=tabSkin;
}
}

File diff suppressed because it is too large Load Diff

@ -9,13 +9,23 @@
"web": "expo start --web"
},
"dependencies": {
"expo": "~46.0.13",
"@react-navigation/bottom-tabs": "^6.4.0",
"@react-navigation/native": "^6.0.13",
"@react-navigation/stack": "^6.3.2",
"expo": "^46.0.15",
"expo-status-bar": "~1.4.0",
"react": "18.0.0",
"react-native": "0.69.6"
"react-dom": "18.0.0",
"react-native": "0.69.6",
"react-native-gesture-handler": "^2.7.1",
"react-native-safe-area-context": "^4.4.1",
"react-native-web": "~0.18.7"
},
"devDependencies": {
"@babel/core": "^7.12.9"
"@babel/core": "^7.12.9",
"@types/react": "~18.0.14",
"@types/react-native": "~0.69.1",
"typescript": "~4.3.5"
},
"private": true
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,81 @@
import * as React from 'react'
import { NavigationContainer } from '@react-navigation/native'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import { createStackNavigator } from '@react-navigation/stack'
import Home from '../screens/Home'
import Store from '../screens/Store'
import Chat from '../screens/Chat'
import Settings from '../screens/Settings'
import Profile from '../screens/Profile'
import Test from '../screens/Test'
const HomeStack = createStackNavigator();
function HomeStackScreen() {
return (
<HomeStack.Navigator screenOptions={{headerShown: false}}>
<HomeStack.Screen name="Home" component={Home} />
<HomeStack.Screen name="Settings" component={Settings} />
</HomeStack.Navigator>
);
}
const StoreStack = createStackNavigator();
function StoreStackScreen() {
return (
<StoreStack.Navigator screenOptions={{headerShown: false}}>
<StoreStack.Screen name="Store" component={Store} />
<StoreStack.Screen name="Settings" component={Settings} />
</StoreStack.Navigator>
);
}
const ChatStack = createStackNavigator();
function ChatStackScreen() {
return (
<ChatStack.Navigator screenOptions={{headerShown: false}}>
<ChatStack.Screen name="Chat" component={Chat} />
<ChatStack.Screen name="Settings" component={Settings} />
</ChatStack.Navigator>
);
}
const ProfileStack = createStackNavigator();
function ProfileStackScreen() {
return (
<ProfileStack.Navigator screenOptions={{headerShown: false}}>
<ProfileStack.Screen name="Profile" component={Profile} />
<ProfileStack.Screen name="Settings" component={Settings} />
</ProfileStack.Navigator>
);
}
const Tab = createBottomTabNavigator()
function MainTabNavigator() {
return (
<NavigationContainer>
<Tab.Navigator
initialRouteName='Home'
backBehavior='none'
screenOptions={{headerShown: false, tabBarStyle: { display: 'none' },}}
>
<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>
)
}
export default MainTabNavigator

@ -0,0 +1,156 @@
import { StatusBar } from 'expo-status-bar'
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
import React from 'react';
const avatar = 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; }) {
const { navigation } = props
return (
<View style={styles.container}>
<View style={styles.header}>
<Pressable onPress={() => navigation.navigate('ProfileTab')}>
<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>
</View>
<View style={styles.body}>
<Text style={styles.text}>couille</Text>
</View>
<View style={styles.footer}>
<Pressable>
<Image
style={styles.iconFooter}
source={message}
/>
</Pressable>
<Pressable onPress={() => navigation.navigate('HomeTab')}>
<Image
style={styles.iconFooter}
source={gamepad}
/>
</Pressable>
<Pressable onPress={() => navigation.navigate('StoreTab')}>
<Image
style={styles.iconStore}
source={store}
/>
</Pressable>
</View>
</View>
);
}
function Button(props: { onPress: any; title?: "Save" | undefined; }) {
const { onPress, title = 'Save' } = props;
return (
<Pressable style={styles.button} onPress={onPress}>
<Text style={styles.text}>{title}</Text>
</Pressable>
);
}
const styles = StyleSheet.create({
body: {
flex: 1,
flexDirection: 'column',
alignItems: 'flex-start',
width: '70%',
},
container: {
flex: 1,
backgroundColor: "#45444E",
flexDirection: "column",
justifyContent: "flex-start",
alignItems: "center",
},
button: {
alignItems: 'center',
justifyContent: 'center',
height: '30%',
width: '100%',
marginTop: '10%',
paddingVertical: 12,
paddingHorizontal: 32,
borderRadius: 10,
elevation: 3,
backgroundColor: '#0085FF',
},
text: {
fontSize: 16,
lineHeight: 21,
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
header: {
flex : 0.15,
width: '100%',
flexDirection: 'row',
backgroundColor: '#2D2C33',
alignItems: 'center',
justifyContent: 'space-around',
},
titre: {
flex: 0.7,
flexDirection: 'column',
textAlign: 'center',
fontSize: 30,
fontFamily: 'Helvetica',
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
engrenage: {
borderRadius: 50,
width: 50,
height: 50,
},
avatar: {
borderRadius: 50,
width: 50,
height: 50,
},
footer: {
flex: 0.15,
flexDirection: 'row',
backgroundColor: '#2D2C33',
flexWrap: 'wrap',
width: '100%',
justifyContent: 'space-evenly',
},
iconFooter: {
marginBot: 25,
marginTop: 10,
width: 65,
height: 50,
},
iconStore: {
marginBot: 25,
marginTop: 10,
marginLeft: 7,
marginRight: 8,
width: 50,
height: 50,
},
});
export default Store

@ -1,31 +1,33 @@
import { StatusBar } from 'expo-status-bar'
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
import React from 'react';
const avatar = require('./src/BobsSkins/BobClassic.png');
const engrenage = require('./src/Icons/Engrenage.png');
const gamepad = require('./src/Icons/Gamepad.png');
const message = require('./src/Icons/Messages.png');
const store = require('./src/Icons/Store.png');
const avatar = require('../../assets/Icons/BobClassic.png');
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');
export default function App() {
return (
function Home(props: { navigation: any; }) {
const { navigation } = props
return (
<View style={styles.container}>
<View style={styles.header}>
<Pressable onPress={() => Alert.alert('Profil Joueur')}>
<Pressable onPress={() => navigation.navigate('ProfileTab')}>
<Image
style={styles.avatar}
source={avatar}
/>
</Pressable>
<Text style={styles.titre}>BOB PARTY</Text>
<Pressable onPress={() => Alert.alert('Paramètres')}>
<Pressable onPress={() => navigation.navigate('Settings')}>
<Image
style={styles.engrenage}
source={engrenage}
/>
</Pressable>
</View>
<View style={styles.buttons}>
<View style={styles.body}>
<Button
title='Jouer Seul'
onPress={() => Alert.alert('On Joue seul')}
@ -36,19 +38,19 @@ export default function App() {
/>
</View>
<View style={styles.footer}>
<Pressable onPress={() => Alert.alert('Messagerie')}>
<Pressable onPress={() => navigation.navigate('ChatTab')}>
<Image
style={styles.iconFooter}
source={message}
/>
</Pressable>
<Pressable onPress={() => Alert.alert('Menu des jeux')}>
<Pressable >
<Image
style={styles.iconFooter}
source={gamepad}
/>
</Pressable>
<Pressable onPress={() => Alert.alert('le magasin')}>
<Pressable onPress={() => navigation.navigate('StoreTab')}>
<Image
style={styles.iconStore}
source={store}
@ -60,7 +62,7 @@ export default function App() {
}
export function Button(props) {
function Button(props: { onPress: any; title?: any | undefined; }) {
const { onPress, title = 'Save' } = props;
return (
<Pressable style={styles.button} onPress={onPress}>
@ -98,49 +100,45 @@ const styles = StyleSheet.create({
color: 'white',
},
header: {
flex : 0.15,
width: '100%',
flexDirection: 'row',
backgroundColor: '#2D2C33',
flexWrap: 'wrap',
width: '100%',
justifyContent: 'space-evenly',
alignItems: 'center',
justifyContent: 'space-around',
},
titre: {
paddingHorizontal: '10%',
paddingTop: 50,
paddingBottom: 10,
flex: 0.7,
flexDirection: 'column',
textAlign: 'center',
fontSize: 30,
fontFamily: 'Helvetica',
lineHeight: 25,
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
engrenage: {
marginTop: 25,
marginRight: 10,
borderRadius: 50,
width: 50,
height: 50,
borderRadius: '50%',
},
avatar: {
marginTop: 25,
marginLeft: 10,
borderRadius: 50,
width: 50,
height: 50,
borderRadius: '50%',
},
buttons: {
body: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
width: '70%',
},
footer: {
flex: 0.15,
flexDirection: 'row',
backgroundColor: '#2D2C33',
flexWrap: 'wrap',
width: '100%',
height: 70,
justifyContent: 'space-evenly',
},
iconFooter: {
@ -159,3 +157,5 @@ const styles = StyleSheet.create({
},
});
export default Home

@ -0,0 +1,156 @@
import { StatusBar } from 'expo-status-bar'
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
import React from 'react';
const avatar = 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; }) {
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}
/>
</Pressable>
</View>
<View style={styles.body}>
<Text style={styles.text}>couille</Text>
</View>
<View style={styles.footer}>
<Pressable onPress={() => navigation.navigate('ChatTab')}>
<Image
style={styles.iconFooter}
source={message}
/>
</Pressable>
<Pressable onPress={() => navigation.navigate('HomeTab')}>
<Image
style={styles.iconFooter}
source={gamepad}
/>
</Pressable>
<Pressable onPress={() => navigation.navigate('StoreTab')}>
<Image
style={styles.iconStore}
source={store}
/>
</Pressable>
</View>
</View>
);
}
function Button(props: { onPress: any; title?: any | undefined; }) {
const { onPress, title = 'Save' } = props;
return (
<Pressable style={styles.button} onPress={onPress}>
<Text style={styles.text}>{title}</Text>
</Pressable>
);
}
const styles = StyleSheet.create({
body: {
flex: 1,
flexDirection: 'column',
alignItems: 'flex-start',
width: '70%',
},
container: {
flex: 1,
backgroundColor: "#45444E",
flexDirection: "column",
justifyContent: "flex-start",
alignItems: "center",
},
button: {
alignItems: 'center',
justifyContent: 'center',
height: '30%',
width: '100%',
marginTop: '10%',
paddingVertical: 12,
paddingHorizontal: 32,
borderRadius: 10,
elevation: 3,
backgroundColor: '#0085FF',
},
text: {
fontSize: 16,
lineHeight: 21,
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
header: {
flex : 0.15,
width: '100%',
flexDirection: 'row',
backgroundColor: '#2D2C33',
alignItems: 'center',
justifyContent: 'space-around',
},
titre: {
flex: 0.7,
flexDirection: 'column',
textAlign: 'center',
fontSize: 30,
fontFamily: 'Helvetica',
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
engrenage: {
borderRadius: 50,
width: 50,
height: 50,
},
avatar: {
borderRadius: 50,
width: 50,
height: 50,
},
footer: {
flex: 0.15,
flexDirection: 'row',
backgroundColor: '#2D2C33',
flexWrap: 'wrap',
width: '100%',
justifyContent: 'space-evenly',
},
iconFooter: {
marginBottom: 25,
marginTop: 10,
width: 65,
height: 50,
},
iconStore: {
marginBottom: 25,
marginTop: 10,
marginLeft: 7,
marginRight: 8,
width: 50,
height: 50,
},
});
export default Store

@ -0,0 +1,131 @@
import { StatusBar } from 'expo-status-bar'
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
import React from 'react';
const msc = require('../../assets/Icons/FondGris.png');
const engrenage = require('../../assets/Icons/UnSelected/Cross.png');
function Store(props: { navigation: any; }) {
const { navigation } = props
return (
<View style={styles.container}>
<View style={styles.header}>
<Image
style={styles.engrenage}
source={msc}
/>
<Text style={styles.titre}>Paramètres</Text>
<Pressable onPress={() => props.navigation.goBack()}>
<Image
style={styles.engrenage}
source={engrenage}
/>
</Pressable>
</View>
<View style={styles.body}>
<Text style={styles.text}>couille</Text>
</View>
</View>
);
}
function Button(props: { onPress: any; title?: any | undefined; }) {
const { onPress, title = 'Save' } = props;
return (
<Pressable style={styles.button} onPress={onPress}>
<Text style={styles.text}>{title}</Text>
</Pressable>
);
}
const styles = StyleSheet.create({
body: {
flex: 1,
flexDirection: 'column',
alignItems: 'flex-start',
width: '70%',
},
container: {
flex: 1,
backgroundColor: "#45444E",
flexDirection: "column",
justifyContent: "flex-start",
alignItems: "center",
},
button: {
alignItems: 'center',
justifyContent: 'center',
height: '30%',
width: '100%',
marginTop: '10%',
paddingVertical: 12,
paddingHorizontal: 32,
borderRadius: 10,
elevation: 3,
backgroundColor: '#0085FF',
},
text: {
fontSize: 16,
lineHeight: 21,
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
header: {
flex : 0.15,
width: '100%',
flexDirection: 'row',
backgroundColor: '#2D2C33',
alignItems: 'center',
justifyContent: 'space-around',
},
titre: {
flex: 0.7,
flexDirection: 'column',
textAlign: 'center',
fontSize: 30,
fontFamily: 'Helvetica',
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
engrenage: {
borderRadius: 10,
width: 50,
height: 50,
},
avatar: {
borderRadius: 10,
width: 50,
height: 50,
},
footer: {
flex: 0.15,
flexDirection: 'row',
backgroundColor: '#2D2C33',
flexWrap: 'wrap',
width: '100%',
justifyContent: 'space-evenly',
},
iconFooter: {
marginBottom: 25,
marginTop: 10,
width: 65,
height: 50,
},
iconStore: {
marginBottom: 25,
marginTop: 10,
marginLeft: 7,
marginRight: 8,
width: 50,
height: 50,
},
});
export default Store

@ -0,0 +1,156 @@
import { StatusBar } from 'expo-status-bar'
import { StyleSheet, View, Text, Alert, Pressable, Image} from 'react-native'
import React from 'react';
const avatar = 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/Selected/SStore.png');
function Store(props: { navigation: any; }) {
const { navigation } = props
return (
<View style={styles.container}>
<View style={styles.header}>
<Pressable onPress={() => navigation.navigate('ProfileTab')}>
<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>
</View>
<View style={styles.body}>
<Text style={styles.text}>couille</Text>
</View>
<View style={styles.footer}>
<Pressable onPress={() => navigation.navigate('ChatTab')}>
<Image
style={styles.iconFooter}
source={message}
/>
</Pressable>
<Pressable onPress={() => navigation.navigate('HomeTab')}>
<Image
style={styles.iconFooter}
source={gamepad}
/>
</Pressable>
<Pressable >
<Image
style={styles.iconStore}
source={store}
/>
</Pressable>
</View>
</View>
);
}
function Button(props: { onPress: any; title?: any | undefined; }) {
const { onPress, title = 'Save' } = props;
return (
<Pressable style={styles.button} onPress={onPress}>
<Text style={styles.text}>{title}</Text>
</Pressable>
);
}
const styles = StyleSheet.create({
body: {
flex: 1,
flexDirection: 'column',
alignItems: 'flex-start',
width: '70%',
},
container: {
flex: 1,
backgroundColor: "#45444E",
flexDirection: "column",
justifyContent: "flex-start",
alignItems: "center",
},
button: {
alignItems: 'center',
justifyContent: 'center',
height: '30%',
width: '100%',
marginTop: '10%',
paddingVertical: 12,
paddingHorizontal: 32,
borderRadius: 10,
elevation: 3,
backgroundColor: '#0085FF',
},
text: {
fontSize: 16,
lineHeight: 21,
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
header: {
flex : 0.15,
width: '100%',
flexDirection: 'row',
backgroundColor: '#2D2C33',
alignItems: 'center',
justifyContent: 'space-around',
},
titre: {
flex: 0.7,
flexDirection: 'column',
textAlign: 'center',
fontSize: 30,
fontFamily: 'Helvetica',
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
engrenage: {
borderRadius: 50,
width: 50,
height: 50,
},
avatar: {
borderRadius: 50,
width: 50,
height: 50,
},
footer: {
flex: 0.15,
flexDirection: 'row',
backgroundColor: '#2D2C33',
flexWrap: 'wrap',
width: '100%',
justifyContent: 'space-evenly',
},
iconFooter: {
marginBottom: 25,
marginTop: 10,
width: 65,
height: 50,
},
iconStore: {
marginBottom: 25,
marginTop: 10,
marginLeft: 7,
marginRight: 8,
width: 50,
height: 50,
},
});
export default Store

@ -0,0 +1,92 @@
import { StatusBar } from 'expo-status-bar'
import { useState } from 'react';
import { StyleSheet, View, Text, Alert, Pressable, Image, ImageBackground} from 'react-native'
import React from 'react';
import { FlatList } from 'react-native-gesture-handler';
const BobClassic = require('../../assets/BobsSkins/BobClassic.png');
const BobBW = require('../../assets/BobsSkins/BobBW.png');
const BobBlue = require('../../assets/BobsSkins/BobBlue.png');
const BobGreen = require('../../assets/BobsSkins/BobGreen.png');
function Test(props: { navigation: any; }) {
const { navigation } = props
const [skin, setSkin] = useState([
{ name : 'BobClassic', image: BobClassic, price: 0, id: 's0001'},
{ name : 'BobBW', image: BobBW, price: 150, id: 's0002'},
{ name : 'BobBlue', image: BobBlue, price: 200, id: 's0003'},
{ name : 'BobGreen', image: BobGreen, price: 200, id: 's0004'},
]);
const ItemSeprator = () => <View style={{
height: 2,
width: "100%",
backgroundColor: "red",
}}/>
return (
<View style={styles.imageWrapper}>
<FlatList
numColumns={2}
keyExtractor={( item ) => item.id }
data={skin}
ItemSeparatorComponent={ItemSeprator}
renderItem={({ item }) => (
<ImageBackground
style={styles.theImage}
source={item.image}
>
<Text>{item.price}</Text>
<Text>{item.name}</Text>
</ImageBackground>
)}
/>
</View>
);
}
const styles = StyleSheet.create({
imageWrapper: {
height: 200,
width: 200,
overflow : "hidden"
},
theImage: {
flex: 1,
alignItems: "flex-end",
margin: 10,
width: "100%",
height: "100%",
},
container: {
backgroundColor: '#45444E',
flex: 1,
paddingTop: "50%",
paddingBottom: "50%",
alignItems: 'center',
justifyContent: 'center',
height: '100%',
},
Text: {
margin: 15,
paddingVertical: 12,
width: '40%',
borderRadius: 10,
backgroundColor: '#0085FF',
},
item: {
marginTop: 24,
backgroundColor: 'pink',
fontSize: 24,
},
debug:{
flex: 0.2,
backgroundColor: "red",
padding: 50,
},
});
export default Test

@ -0,0 +1,7 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"jsx": "react",
"strict": true
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,106 @@
#Drop all the tables
DROP TABLE Battle;
DROP TABLE Own;
DROP TABLE Message;
DROP TABLE Belong;
DROP TABLE ConvGroup;
DROP TABLE User;
DROP TABLE Skin;
DROP TABLE Game;
#Create the User table
CREATE TABLE User (
ID char(5) PRIMARY KEY,
Username varchar(20) NOT NULL,
Nationality varchar(20) NOT NULL,
Sex char(1) NOT NULL,
DateOfBirth date NOT NULL,
CurrentBobCoins bigint(255) DEFAULT 0,
TotalBobCoins bigint(255) DEFAULT 0
);
#Create the Skin table
CREATE TABLE Skin (
ID char(5) PRIMARY KEY,
Name varchar(20) UNIQUE NOT NULL,
Image varchar(20) UNIQUE NOT NULL
);
#Create the Own table
CREATE TABLE Own (
IDSkin char(5),
IDUser char(5),
CONSTRAINT FK_Skin FOREIGN KEY (IDSkin) REFERENCES User(ID),
CONSTRAINT FK_User FOREIGN KEY (IDUser) REFERENCES Skin(ID),
PRIMARY KEY (IDUser, IDSkin)
);
#Create the Game table
CREATE TABLE Game (
ID char(5) PRIMARY KEY,
Name varchar(20) UNIQUE NOT NULL
);
#Create the Match table
CREATE TABLE Battle (
ID char(5) PRIMARY KEY,
Winner char(5) NOT NULL,
Loser char(5) NOT NULL,
Game char(5) NOT NULL,
CONSTRAINT Fk_Winner FOREIGN KEY (Winner) REFERENCES User(ID),
CONSTRAINT Fk_Loser FOREIGN KEY (Loser) REFERENCES User(ID),
CONSTRAINT Fk_Game FOREIGN KEY (Game) REFERENCES Game(ID)
);
#Create the Group table
CREATE TABLE ConvGroup (
ID char(5) PRIMARY KEY,
Name varchar(20) NOT NULL
);
#Create the Message table
CREATE TABLE Message (
ID char(5) PRIMARY KEY,
Message text NOT NULL,
IDSender char(5) NOT NULL,
IDUserReceiver char(5),
IDGroupReceiver char(5),
CONSTRAINT Fk_Sender FOREIGN KEY (IDSender) REFERENCES User(ID),
CONSTRAINT Fk_UsRec FOREIGN KEY (IDUserReceiver) REFERENCES User(ID),
CONSTRAINT Fk_GrRec FOREIGN KEY (IDGroupReceiver) REFERENCES ConvGroup(ID)
);
#Create the Belong Table
CREATE TABLE Belong (
IDUser char(5),
IDGroup char(5),
CONSTRAINT Fk_UserID FOREIGN KEY (IDUser) REFERENCES User(ID),
CONSTRAINT Fk_Group FOREIGN KEY (IDGroup) REFERENCES ConvGroup(ID),
PRIMARY KEY (IDUser, IDGroup)
);
Loading…
Cancel
Save