Skip to content

Commit fbe1d19

Browse files
author
Ervin
committed
Profile
1 parent 20e10c8 commit fbe1d19

File tree

4 files changed

+138
-120
lines changed

4 files changed

+138
-120
lines changed

App/auth/Auth.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ export const isSignedIn = () => {
6161
AsyncStorage.getItem("token")
6262
.then(res => {
6363

64-
console.log(res)
65-
6664
if (res !== null) {
6765

6866
resolve(true);

App/view/Inscription.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,16 @@ export class Inscription extends Component {
179179
<KeyboardAvoidingView
180180
contentContainerStyle={styles.keyboard}
181181
behavior={"height"}
182-
keyboardVerticalOffset={-10}
182+
keyboardVerticalOffset={-40}
183183
>
184184

185185
{/* Modal : Inscription réussit */}
186186

187187
<View style={{
188188
backgroundColor: '#fff',
189189
alignItems: 'center',
190-
justifyContent: 'center'
190+
justifyContent: 'center',
191+
marginTop: 20
191192
}}>
192193

193194
<SCLAlert

App/view/Login.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ const styles = StyleSheet.create({
292292
alignItems: 'center',
293293
flex: 1,
294294
paddingLeft:40,
295-
paddingRight:40
295+
paddingRight:40,
296296
},
297297
textInput: {
298298
width : 280,
@@ -324,12 +324,28 @@ const styles = StyleSheet.create({
324324
buttonConnection: {
325325
backgroundColor: '#2C5077',
326326
width: 120,
327-
height: 50
327+
height: 50,
328+
shadowColor: "#000",
329+
shadowOffset: {
330+
width: 0,
331+
height: 2,
332+
},
333+
shadowOpacity: 0.25,
334+
shadowRadius: 3.84,
335+
elevation: 5,
328336
},
329337
buttonRegister: {
330338
borderColor: '#2C5077',
331339
width: 120,
332-
height: 50
340+
height: 50,
341+
shadowColor: "#000",
342+
shadowOffset: {
343+
width: 0,
344+
height: 2,
345+
},
346+
shadowOpacity: 0.25,
347+
shadowRadius: 3.84,
348+
elevation: 5,
333349
},
334350
inputSection: {
335351
flexDirection: 'row',

App/view/Profile.js

Lines changed: 116 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, {Component} from 'react';
22
import {NavigationEvents, ScrollView} from "react-navigation";
33
import {Text, TextInput, View, Dimensions} from "react-native";
44
import {Button, Avatar, Divider} from "react-native-elements";
5-
import { BarChart, Grid,XAxis,LineChart } from 'react-native-svg-charts'
5+
import { BarChart, Grid,XAxis, YAxis, LineChart } from 'react-native-svg-charts'
66
import {onSignIn} from "../auth/Auth";
77
import {createStackNavigator} from "@react-navigation/stack";
88
import {NavigationContainer} from "@react-navigation/native";
@@ -33,8 +33,8 @@ class DetailProfile extends React.Component {
3333
}
3434

3535
render() {
36-
const fill = 'rgb(14, 65, 244)'
37-
const data = [ 4, 12, 10, 7, 4, 6, 8,4,10,10,10,10 ]
36+
const fill = '#2C5077'
37+
const data = [ 4, 30, 10, 7, 4, 6, 8, 4, 10, 10, 10, 10 ]
3838

3939

4040
const saveDatas = async () => {
@@ -47,134 +47,137 @@ class DetailProfile extends React.Component {
4747

4848
return(
4949
<ScrollView style={{flex: 1,backgroundColor:'white'}}>
50-
<View style={{flex: 1}}>
51-
<View style={{flex: 4, alignItems: 'center', flexDirection: 'row', justifyContent: 'center',marginTop:20}}>
52-
<Avatar
53-
size="xlarge"
54-
rounded
55-
icon={{ name: 'account-circle',type:'material' }}
56-
57-
58-
onPress={() => console.log("Works!")}
59-
activeOpacity={0.7}
60-
/>
61-
</View>
62-
<View>
63-
<View style={{marginTop:20,alignItems: 'center', flexDirection: 'row',justifyContent: 'center'}}>
64-
<Button
65-
//buttonStyle={styles.buttonConnection}
66-
buttonStyle={{backgroundColor: '#2C5077',
67-
width: 120,
68-
height: 50}}
69-
title="Déconnecter"
70-
type="solid"
71-
color="#2C5077"
72-
// onPress={handleSubmit}
73-
onPress={() => {
74-
this.forceUpdate();
75-
}}
76-
/>
77-
</View>
78-
</View>
79-
<Divider style={{ backgroundColor: 'black',marginTop:20 }} />
50+
<View style={{flex: 1, alignItems: 'center', flexDirection: 'column'}}>
51+
52+
<Avatar
53+
size={90}
54+
icon={{ name: 'user',type:'font-awesome' }}
55+
rounded
56+
onPress={() => console.log("Works!")}
57+
activeOpacity={0.7}
58+
containerStyle={{ marginTop: 20 }}
59+
/>
8060

61+
<Text style={{ fontSize: 20, fontWeight: "bold", marginTop: 10 }}>Ervin SALIF</Text>
62+
<Text style={{ marginTop: 10 }}>Membre depuis le 19 nov. 2019</Text>
63+
64+
<Button
65+
buttonStyle={{backgroundColor: '#2C5077', width: 120, height: 50, marginTop: 20}}
66+
title="Déconnecter"
67+
type="solid"
68+
color="#2C5077"
69+
// onPress={handleSubmit}
70+
onPress={() => {
71+
this.forceUpdate();
72+
}}
73+
/>
8174

75+
<Divider style={{ backgroundColor: 'black', marginTop:20 }} />
8276

8377
</View>
84-
<View style={{flex: 1}}>
78+
79+
<View style={{flex: 1, backgroundColor: '#ffffe6', paddingBottom: 20}}>
8580
<Text
8681
style={{
8782
textAlign: 'center',
8883
fontSize: 18,
8984
padding: 16,
85+
color: '#2C5077',
86+
fontWeight: 'bold'
9087
}}>
91-
Statistique de courses
88+
Statistique des courses
9289
</Text>
93-
<BarChart
94-
style={{ height: 200 }}
95-
data={ data }
96-
svg={{ fill }}
97-
contentInset={{ top: 30, bottom: 30 }}
98-
>
99-
</BarChart>
100-
<XAxis
101-
style={{ marginHorizontal: -10 }}
102-
data={ data }
103-
formatLabel={ (value, index) => index }
104-
contentInset={{ left: 10, right: 10 }}
105-
svg={{ fontSize: 10, fill: 'black' }}
106-
/>
10790

108-
</View>
91+
<View style={{ flex: 1, alignItems: 'center' }}>
10992

110-
<View style={{flex: 1, height: 600}}>
93+
<BarChart
94+
style={{ height: 170, width: '80%' }}
95+
data={ data }
96+
svg={{ fill }}
97+
contentInset={{ top: 30, bottom: 30 }}
98+
>
99+
</BarChart>
111100

112-
<View style={{borderColor: "black", borderWidth: 1, margin: 10, flex: 1}}>
113-
<Text style={{fontSize: 20, margin: 5}}>
114-
Nom
115-
</Text>
116-
<TextInput style={{borderColor: 'gray', borderWidth: 1, width: 300, alignSelf: "flex-end", marginRight: 10}}
117-
onChangeText={text => this.setState({tempnom: text})}
118-
value={this.state.tempnom}>
119-
</TextInput>
120101
</View>
121102

122-
<View style={{borderColor: "black", borderWidth: 1, margin: 10, flex: 1}}>
123-
<Text style={{fontSize: 20, margin: 5}}>
124-
Prenom
125-
</Text>
126-
<TextInput style={{borderColor: 'gray', borderWidth: 1, width: 300, alignSelf: "flex-end", marginRight: 10}}
127-
onChangeText={text => this.setState({tempprenom: text})}
128-
value={this.state.tempprenom}>
129-
</TextInput>
130-
</View>
131-
132-
<View style={{borderColor: "black", borderWidth: 1, margin: 10, flex: 1}}>
133-
<Text style={{fontSize: 20, margin: 5}}>
134-
Poids
135-
</Text>
136-
<TextInput style={{borderColor: 'gray', borderWidth: 1, width: 300, alignSelf: "flex-end", marginRight: 10}}
137-
onChangeText={text => this.setState({temppoids: text})}
138-
value={this.state.temppoids}>
139-
</TextInput>
140-
</View>
141-
142-
<View style={{borderColor: "black", borderWidth: 1, margin: 10, flex: 1}}>
143-
<Text style={{fontSize: 20, margin: 5}}>
144-
Adresse mail
145-
</Text>
146-
<TextInput style={{borderColor: 'gray', borderWidth: 1, width: 300, alignSelf: "flex-end", marginRight: 10}}
147-
onChangeText={text => this.setState({tempadresseMail: text})}
148-
value={this.state.tempadresseMail}>
149-
</TextInput>
150-
</View>
151-
152-
<View style={{borderColor: "black", borderWidth: 1, margin: 10, flex: 1}}>
153-
<Text style={{fontSize: 20, margin: 5}}>
154-
Mot de passe
155-
</Text>
156-
<TextInput style={{borderColor: 'gray', borderWidth: 1, width: 300, alignSelf: "flex-end", marginRight: 10}}
157-
onChangeText={text => this.setState({tempmdp: text})}
158-
value={this.state.tempmdp}>
159-
</TextInput>
160-
</View>
103+
<XAxis
104+
style={{ flex: 1, marginHorizontal: 35 }}
105+
data={ data }
106+
formatLabel={(value, index) => data[ index ]}
107+
contentInset={{ left: 13, right: 13 }}
108+
svg={{ fontSize: 12, fill: 'black', fontWeight: 'bold' }}
109+
/>
161110

162-
<View style={{margin: 10, flex: 1, justifyContent: "center"}}>
163-
<Button
164-
//buttonStyle={styles.buttonConnection}
165-
title="Sauvegarder"
166-
type="solid"
167-
color="#2C5077"
168-
// onPress={handleSubmit}
169-
onPress={() => {
170-
// this.props.navigation.navigate('Home');
171-
// onSignIn().then(() => this.props.navigation.navigate('SignedIn'));
172-
saveDatas()
173-
}}
174-
/>
175-
</View>
176111
</View>
177112

113+
{/*<View style={{flex: 1, height: 600}}>*/}
114+
115+
{/* <View style={{borderColor: "black", borderWidth: 1, margin: 10, flex: 1}}>*/}
116+
{/* <Text style={{fontSize: 20, margin: 5}}>*/}
117+
{/* Nom*/}
118+
{/* </Text>*/}
119+
{/* <TextInput style={{borderColor: 'gray', borderWidth: 1, width: 300, alignSelf: "flex-end", marginRight: 10}}*/}
120+
{/* onChangeText={text => this.setState({tempnom: text})}*/}
121+
{/* value={this.state.tempnom}>*/}
122+
{/* </TextInput>*/}
123+
{/* </View>*/}
124+
125+
{/* <View style={{borderColor: "black", borderWidth: 1, margin: 10, flex: 1}}>*/}
126+
{/* <Text style={{fontSize: 20, margin: 5}}>*/}
127+
{/* Prenom*/}
128+
{/* </Text>*/}
129+
{/* <TextInput style={{borderColor: 'gray', borderWidth: 1, width: 300, alignSelf: "flex-end", marginRight: 10}}*/}
130+
{/* onChangeText={text => this.setState({tempprenom: text})}*/}
131+
{/* value={this.state.tempprenom}>*/}
132+
{/* </TextInput>*/}
133+
{/* </View>*/}
134+
135+
{/* <View style={{borderColor: "black", borderWidth: 1, margin: 10, flex: 1}}>*/}
136+
{/* <Text style={{fontSize: 20, margin: 5}}>*/}
137+
{/* Poids*/}
138+
{/* </Text>*/}
139+
{/* <TextInput style={{borderColor: 'gray', borderWidth: 1, width: 300, alignSelf: "flex-end", marginRight: 10}}*/}
140+
{/* onChangeText={text => this.setState({temppoids: text})}*/}
141+
{/* value={this.state.temppoids}>*/}
142+
{/* </TextInput>*/}
143+
{/* </View>*/}
144+
145+
{/* <View style={{borderColor: "black", borderWidth: 1, margin: 10, flex: 1}}>*/}
146+
{/* <Text style={{fontSize: 20, margin: 5}}>*/}
147+
{/* Adresse mail*/}
148+
{/* </Text>*/}
149+
{/* <TextInput style={{borderColor: 'gray', borderWidth: 1, width: 300, alignSelf: "flex-end", marginRight: 10}}*/}
150+
{/* onChangeText={text => this.setState({tempadresseMail: text})}*/}
151+
{/* value={this.state.tempadresseMail}>*/}
152+
{/* </TextInput>*/}
153+
{/* </View>*/}
154+
155+
{/* <View style={{borderColor: "black", borderWidth: 1, margin: 10, flex: 1}}>*/}
156+
{/* <Text style={{fontSize: 20, margin: 5}}>*/}
157+
{/* Mot de passe*/}
158+
{/* </Text>*/}
159+
{/* <TextInput style={{borderColor: 'gray', borderWidth: 1, width: 300, alignSelf: "flex-end", marginRight: 10}}*/}
160+
{/* onChangeText={text => this.setState({tempmdp: text})}*/}
161+
{/* value={this.state.tempmdp}>*/}
162+
{/* </TextInput>*/}
163+
{/* </View>*/}
164+
165+
{/* <View style={{margin: 10, flex: 1, justifyContent: "center"}}>*/}
166+
{/* <Button*/}
167+
{/* //buttonStyle={styles.buttonConnection}*/}
168+
{/* title="Sauvegarder"*/}
169+
{/* type="solid"*/}
170+
{/* color="#2C5077"*/}
171+
{/* // onPress={handleSubmit}*/}
172+
{/* onPress={() => {*/}
173+
{/* // this.props.navigation.navigate('Home');*/}
174+
{/* // onSignIn().then(() => this.props.navigation.navigate('SignedIn'));*/}
175+
{/* saveDatas()*/}
176+
{/* }}*/}
177+
{/* />*/}
178+
{/* </View>*/}
179+
{/*</View>*/}
180+
178181

179182
<NavigationEvents
180183
onDidFocus={() => console.log('test')}
@@ -190,7 +193,7 @@ function MyStack() {
190193
return (
191194
<Stack.Navigator>
192195
<Stack.Screen name="ActivityScreen" component={DetailProfile} options={{
193-
title: 'Profile',
196+
title: 'Profil',
194197
}} />
195198
</Stack.Navigator>
196199
);

0 commit comments

Comments
 (0)