@ -29,14 +29,12 @@ function Settings(props: { navigation: any; }) {
function changeUsername ( username :string ) {
function changeUsername ( username :string ) {
MANAGER_USER . getCurrentUser ( ) ? . setUsername ( username ) ;
MANAGER_USER . getCurrentUser ( ) ? . setUsername ( username ) ;
console . log ( MANAGER_USER . getCurrentUser ( ) ? . getUsername ( ) ) ;
setUser ( MANAGER_USER . getCurrentUser ( ) ) ;
setUser ( MANAGER_USER . getCurrentUser ( ) ) ;
MANAGER_USER . getsaverUser ( ) . updateUser ( MANAGER_USER . getCurrentUser ( ) ) ;
MANAGER_USER . getsaverUser ( ) . updateUser ( MANAGER_USER . getCurrentUser ( ) ) ;
}
}
function changePassword ( password :string ) {
function changePassword ( password :string ) {
MANAGER_USER . getCurrentUser ( ) ? . setPassword ( password ) ;
MANAGER_USER . getCurrentUser ( ) ? . setPassword ( password ) ;
console . log ( MANAGER_USER . getCurrentUser ( ) ? . getPassword ( ) ) ;
setUser ( MANAGER_USER . getCurrentUser ( ) ) ;
setUser ( MANAGER_USER . getCurrentUser ( ) ) ;
MANAGER_USER . getsaverUser ( ) . updateUser ( MANAGER_USER . getCurrentUser ( ) ) ;
MANAGER_USER . getsaverUser ( ) . updateUser ( MANAGER_USER . getCurrentUser ( ) ) ;
}
}
@ -55,24 +53,24 @@ function Settings(props: { navigation: any; }) {
< View style = { { flexDirection : 'row' , justifyContent : 'space-between' , } } >
< View style = { { flexDirection : 'row' , justifyContent : 'space-between' , } } >
< View >
< View >
< View >
< View >
< Text style = { styles . text } > Pseudo : { MANAGER_USER. getCurrentUser ( ) . getUsername ( ) } < / Text >
< Text style = { styles . text } > Pseudo : { useUserStore( ) . user ? . getUsername ( ) } < / Text >
< ButtonGreySmall onPress = { ( ) = > { console . log ( dialogPseudoVisible ) ;
< ButtonGreySmall onPress = { ( ) = > { console . log ( dialogPseudoVisible ) ;
; setDialogPseudoVisible ( true ) } } title = 'Changer le pseudo' / >
; setDialogPseudoVisible ( true ) } } title = 'Changer le pseudo' / >
< / View >
< / View >
< View >
< View >
< Text style = { styles . text } > Mot de passe : { MANAGER_USER. getCurrentUser ( ) . getPassword ( ) } < / Text >
< Text style = { styles . text } > Mot de passe : { useUserStore( ) . user ? . getPassword ( ) } < / Text >
< ButtonGreySmall onPress = { ( ) = > setDialogPasswordVisible ( true ) } title = 'Changer le mot de passe' / >
< ButtonGreySmall onPress = { ( ) = > setDialogPasswordVisible ( true ) } title = 'Changer le mot de passe' / >
< / View >
< / View >
< View >
< View >
< Text style = { styles . text } > Nationalit é : { MANAGER_USER. getCurrentUser ( ) . getNationality ( ) } < / Text >
< Text style = { styles . text } > Nationalit é : { useUserStore( ) . user ? . getNationality ( ) } < / Text >
< PickerGreySmall title = 'Changer la nationalité' valueChange = { ( value :string ) = > setSelectedNationality ( value ) } donePress = { ( ) = > dispatch ( updateNationality ( selectedNationality ) ) } values = { [ "Francais" , "Anglais" ] } / >
< PickerGreySmall title = 'Changer la nationalité' valueChange = { ( value :string ) = > setSelectedNationality ( value ) } donePress = { ( ) = > dispatch ( updateNationality ( selectedNationality ) ) } values = { [ "Francais" , "Anglais" ] } / >
< / View >
< / View >
< View >
< View >
< Text style = { styles . text } > Sexe : { MANAGER_USER. getCurrentUser ( ) . getSexe ( ) } < / Text >
< Text style = { styles . text } > Sexe : { useUserStore( ) . user ? . getSexe ( ) } < / Text >
< PickerGreySmall title = 'Changer le sexe' valueChange = { ( value :string ) = > setSelectedSex ( value ) } donePress = { ( ) = > dispatch ( updateSex ( selectedSex ) ) } values = { [ "Homme" , "Femme" , "Autre" ] } / >
< PickerGreySmall title = 'Changer le sexe' valueChange = { ( value :string ) = > setSelectedSex ( value ) } donePress = { ( ) = > dispatch ( updateSex ( selectedSex ) ) } values = { [ "Homme" , "Femme" , "Autre" ] } / >
< / View >
< / View >
< / View >
< / View >
< Text style = { styles . textID } > ID : { MANAGER_USER. getCurrentUser ( ) . getId ( ) } < / Text >
< Text style = { styles . textID } > ID : { useUserStore( ) . user ? . getId ( ) } < / Text >
< / View >
< / View >
< / View >
< / View >
< / View >
< / View >