CHANGE: changement de tous les fichiers en fichiers typescript

typescript
Thomas Chazot 2 years ago
parent 49d2683673
commit 40900ed0ed

@ -8,6 +8,7 @@
"name": "bob_party",
"version": "1.0.0",
"dependencies": {
"@react-navigation/bottom-tabs": "^6.4.0",
"@react-navigation/native": "^6.0.13",
"@react-navigation/stack": "^6.3.2",
"expo": "~46.0.13",
@ -4330,6 +4331,23 @@
"resolved": "https://registry.npmjs.org/@react-native/polyfills/-/polyfills-2.0.0.tgz",
"integrity": "sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ=="
},
"node_modules/@react-navigation/bottom-tabs": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/@react-navigation/bottom-tabs/-/bottom-tabs-6.4.0.tgz",
"integrity": "sha512-90CapiXjiWudbCiki9e6fOr/CECQRguIxv5OD7IBfbAMGX5GGiJpX8aqiHAz2DxpAz31v4JZcUr945+lFhXBfA==",
"dependencies": {
"@react-navigation/elements": "^1.3.6",
"color": "^4.2.3",
"warn-once": "^0.1.0"
},
"peerDependencies": {
"@react-navigation/native": "^6.0.0",
"react": "*",
"react-native": "*",
"react-native-safe-area-context": ">= 3.0.0",
"react-native-screens": ">= 3.0.0"
}
},
"node_modules/@react-navigation/core": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-6.4.0.tgz",
@ -15766,6 +15784,16 @@
"resolved": "https://registry.npmjs.org/@react-native/polyfills/-/polyfills-2.0.0.tgz",
"integrity": "sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ=="
},
"@react-navigation/bottom-tabs": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/@react-navigation/bottom-tabs/-/bottom-tabs-6.4.0.tgz",
"integrity": "sha512-90CapiXjiWudbCiki9e6fOr/CECQRguIxv5OD7IBfbAMGX5GGiJpX8aqiHAz2DxpAz31v4JZcUr945+lFhXBfA==",
"requires": {
"@react-navigation/elements": "^1.3.6",
"color": "^4.2.3",
"warn-once": "^0.1.0"
}
},
"@react-navigation/core": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-6.4.0.tgz",

@ -9,6 +9,7 @@
"web": "expo start --web"
},
"dependencies": {
"@react-navigation/bottom-tabs": "^6.4.0",
"@react-navigation/native": "^6.0.13",
"@react-navigation/stack": "^6.3.2",
"expo": "~46.0.13",

@ -1,39 +1,68 @@
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 Test from '../screens/Test'
const Stack = createStackNavigator()
const HomeStack = createStackNavigator();
function MainStackNavigator() {
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 Tab = createBottomTabNavigator()
function MainTabNavigator() {
return (
<NavigationContainer>
<Stack.Navigator
initialRouteName='Test'
screenOptions={{headerShown: false,}}
<Tab.Navigator
initialRouteName='Home'
backBehavior='none'
screenOptions={{headerShown: false, tabBarStyle: { display: 'none' },}}
>
<Stack.Screen
name='Home'
component={Home}
/>
<Stack.Screen
name='Store'
component={Store}
/>
<Stack.Screen
name='Test'
component={Test}
/>
</Stack.Navigator>
<Tab.Screen name='Home' component={HomeStackScreen} />
<Tab.Screen name='Store' component={StoreStackScreen} />
<Tab.Screen name='Chat' component={ChatStackScreen} />
<Tab.Screen name='Test' component={Test} />
</Tab.Navigator>
</NavigationContainer>
)
}
export default MainStackNavigator
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/Engrenage.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) {
const { navigation } = props
return (
<View style={styles.container}>
<View style={styles.header}>
<Pressable onPress={() => Alert.alert('Profil Joueur')}>
<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('Home')}>
<Image
style={styles.iconFooter}
source={gamepad}
/>
</Pressable>
<Pressable onPress={() => navigation.navigate('Store')}>
<Image
style={styles.iconStore}
source={store}
/>
</Pressable>
</View>
</View>
);
}
function Button(props) {
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: {
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,11 +1,12 @@
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/Engrenage.png');
const gamepad = require('../../assets/Icons/Gamepad.png');
const message = require('../../assets/Icons/Messages.png');
const store = require('../../assets/Icons/Store.png');
const engrenage = require('../../assets/Icons/UnSelected/Engrenage.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
@ -14,14 +15,14 @@ function Home(props: { navigation: any; }) {
<View style={styles.header}>
<Pressable onPress={() => Alert.alert('Profil Joueur')}>
<Image
//style={styles.avatar}
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}
style={styles.engrenage}
source={engrenage}
/>
</Pressable>
@ -37,21 +38,21 @@ function Home(props: { navigation: any; }) {
/>
</View>
<View style={styles.footer}>
<Pressable onPress={() => Alert.alert('Messagerie')}>
<Pressable onPress={() => navigation.navigate('Chat')}>
<Image
//style={styles.iconFooter}
style={styles.iconFooter}
source={message}
/>
</Pressable>
<Pressable onPress={() => Alert.alert('Menu des jeux')}>
<Pressable >
<Image
//style={styles.iconFooter}
style={styles.iconFooter}
source={gamepad}
/>
</Pressable>
<Pressable onPress={() => navigation.navigate('Store')}>
<Image
//style={styles.iconStore}
style={styles.iconStore}
source={store}
/>
</Pressable>
@ -61,7 +62,7 @@ function Home(props: { navigation: any; }) {
}
function Button(props: { onPress: any; title?: string | undefined; }) {
function Button(props) {
const { onPress, title = 'Save' } = props;
return (
<Pressable style={styles.button} onPress={onPress}>
@ -141,13 +142,13 @@ const styles = StyleSheet.create({
justifyContent: 'space-evenly',
},
iconFooter: {
marginBottom: 25,
marginBot: 25,
marginTop: 10,
width: 65,
height: 50,
},
iconStore: {
marginBottom: 25,
marginBot: 25,
marginTop: 10,
marginLeft: 7,
marginRight: 8,

@ -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/Cross.png');
function Store(props) {
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) {
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

@ -1,27 +1,28 @@
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/Engrenage.png');
const gamepad = require('../../assets/Icons/Gamepad.png');
const message = require('../../assets/Icons/Messages.png');
const store = require('../../assets/Icons/Store.png');
const engrenage = require('../../assets/Icons/UnSelected/Engrenage.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; }) {
function Store(props) {
const { navigation } = props
return (
<View style={styles.container}>
<View style={styles.header}>
<Pressable onPress={() => Alert.alert('Profil Joueur')}>
<Image
//style={styles.avatar}
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}
style={styles.engrenage}
source={engrenage}
/>
</Pressable>
@ -30,21 +31,21 @@ function Store(props: { navigation: any; }) {
<Text style={styles.text}>couille</Text>
</View>
<View style={styles.footer}>
<Pressable onPress={() => Alert.alert('Messagerie')}>
<Pressable onPress={() => navigation.navigate('Chat')}>
<Image
//style={styles.iconFooter}
style={styles.iconFooter}
source={message}
/>
</Pressable>
<Pressable onPress={() => navigation.navigate('Home')}>
<Image
//style={styles.iconFooter}
style={styles.iconFooter}
source={gamepad}
/>
</Pressable>
<Pressable onPress={() => Alert.alert('le magasin')}>
<Pressable >
<Image
//style={styles.iconStore}
style={styles.iconStore}
source={store}
/>
</Pressable>
@ -54,7 +55,7 @@ function Store(props: { navigation: any; }) {
}
function Button(props: { onPress: any; title?: "Save" | undefined; }) {
function Button(props) {
const { onPress, title = 'Save' } = props;
return (
<Pressable style={styles.button} onPress={onPress}>
@ -117,7 +118,7 @@ const styles = StyleSheet.create({
color: 'white',
},
engrenage: {
borderRadius: 10,
borderRadius: 50,
width: 50,
height: 50,
},

@ -1,6 +1,7 @@
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');
@ -10,7 +11,7 @@ const BobGreen = require('../../assets/BobsSkins/BobGreen.png');
function Test(props: { navigation: any; }) {
function Test(props) {
const { navigation } = props
const [skin, setSkin] = useState([
@ -61,8 +62,8 @@ const styles = StyleSheet.create({
height: "100%",
},
container: {
flex: 1,
backgroundColor: '#45444E',
flex: 1,
paddingTop: "50%",
paddingBottom: "50%",
alignItems: 'center',

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save