@@ -2,7 +2,7 @@ import React, {Component} from 'react';
2
2
import { NavigationEvents , ScrollView } from "react-navigation" ;
3
3
import { Text , TextInput , View , Dimensions } from "react-native" ;
4
4
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'
6
6
import { onSignIn } from "../auth/Auth" ;
7
7
import { createStackNavigator } from "@react-navigation/stack" ;
8
8
import { NavigationContainer } from "@react-navigation/native" ;
@@ -33,8 +33,8 @@ class DetailProfile extends React.Component {
33
33
}
34
34
35
35
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 ]
38
38
39
39
40
40
const saveDatas = async ( ) => {
@@ -47,134 +47,137 @@ class DetailProfile extends React.Component {
47
47
48
48
return (
49
49
< 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
+ />
80
60
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
+ />
81
74
75
+ < Divider style = { { backgroundColor : 'black' , marginTop :20 } } />
82
76
83
77
</ View >
84
- < View style = { { flex : 1 } } >
78
+
79
+ < View style = { { flex : 1 , backgroundColor : '#ffffe6' , paddingBottom : 20 } } >
85
80
< Text
86
81
style = { {
87
82
textAlign : 'center' ,
88
83
fontSize : 18 ,
89
84
padding : 16 ,
85
+ color : '#2C5077' ,
86
+ fontWeight : 'bold'
90
87
} } >
91
- Statistique de courses
88
+ Statistique des courses
92
89
</ 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
- />
107
90
108
- </ View >
91
+ < View style = { { flex : 1 , alignItems : 'center' } } >
109
92
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 >
111
100
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 >
120
101
</ View >
121
102
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
+ />
161
110
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 >
176
111
</ View >
177
112
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
+
178
181
179
182
< NavigationEvents
180
183
onDidFocus = { ( ) => console . log ( 'test' ) }
@@ -190,7 +193,7 @@ function MyStack() {
190
193
return (
191
194
< Stack . Navigator >
192
195
< Stack . Screen name = "ActivityScreen" component = { DetailProfile } options = { {
193
- title : 'Profile ' ,
196
+ title : 'Profil ' ,
194
197
} } />
195
198
</ Stack . Navigator >
196
199
) ;
0 commit comments