|
|
@ -4,7 +4,7 @@ import { TextInput, TouchableOpacity } from 'react-native-gesture-handler';
|
|
|
|
import { Svg, Path } from 'react-native-svg';
|
|
|
|
import { Svg, Path } from 'react-native-svg';
|
|
|
|
import Modal from "react-native-modal";
|
|
|
|
import Modal from "react-native-modal";
|
|
|
|
import { useNavigation } from "@react-navigation/native";
|
|
|
|
import { useNavigation } from "@react-navigation/native";
|
|
|
|
import { useSelector } from 'react-redux';
|
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
|
|
|
|
|
|
|
|
|
|
|
import normalize from '../components/Normalize';
|
|
|
|
import normalize from '../components/Normalize';
|
|
|
|
import * as ImagePicker from 'expo-image-picker';
|
|
|
|
import * as ImagePicker from 'expo-image-picker';
|
|
|
@ -23,23 +23,20 @@ const DismissKeyboard = ({ children }) => (
|
|
|
|
|
|
|
|
|
|
|
|
export default function SettingProfil() {
|
|
|
|
export default function SettingProfil() {
|
|
|
|
//Dark Mode
|
|
|
|
//Dark Mode
|
|
|
|
const [isDark, setIsDark] = useState(null);
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
useEffect(() => {
|
|
|
|
const isDark = useSelector(state => state.userReducer.dark);
|
|
|
|
const retrieveDarkMode = async () => {
|
|
|
|
const UserCurrent = useSelector(state => state.userReducer.user);
|
|
|
|
const darkModeValue = await AsyncStorage.getItem('dark');
|
|
|
|
|
|
|
|
if (darkModeValue !== null) {
|
|
|
|
|
|
|
|
setIsDark(JSON.parse(darkModeValue));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
retrieveDarkMode();
|
|
|
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
const style = isDark ? GraphicalCharterDark : GraphicalCharterLight;
|
|
|
|
const style = isDark ? GraphicalCharterDark : GraphicalCharterLight;
|
|
|
|
|
|
|
|
|
|
|
|
const [image, setImage] = useState(null);
|
|
|
|
|
|
|
|
const navigation = useNavigation();
|
|
|
|
const navigation = useNavigation();
|
|
|
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
|
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
|
|
const [isModalVisible, setIsModalVisible] = React.useState(false);
|
|
|
|
const [isModalVisible, setIsModalVisible] = React.useState(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
|
|
console.log(UserCurrent.image);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const handleModal = () => setIsModalVisible(() => !isModalVisible);
|
|
|
|
const handleModal = () => setIsModalVisible(() => !isModalVisible);
|
|
|
|
// @ts-ignore
|
|
|
|
// @ts-ignore
|
|
|
|
const viewableItemsChanged = useRef(({ viewableItems }) => {
|
|
|
|
const viewableItemsChanged = useRef(({ viewableItems }) => {
|
|
|
@ -54,11 +51,7 @@ export default function SettingProfil() {
|
|
|
|
aspect: [4, 3],
|
|
|
|
aspect: [4, 3],
|
|
|
|
quality: 1,
|
|
|
|
quality: 1,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
console.log(result);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!result.canceled) {
|
|
|
|
if (!result.canceled) {
|
|
|
|
setImage(result.assets[0].uri);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -182,12 +175,12 @@ export default function SettingProfil() {
|
|
|
|
textInputId: {
|
|
|
|
textInputId: {
|
|
|
|
marginLeft: 50,
|
|
|
|
marginLeft: 50,
|
|
|
|
width: '57%',
|
|
|
|
width: '57%',
|
|
|
|
color: 'white',
|
|
|
|
color: style.Text,
|
|
|
|
fontSize: normalize(18),
|
|
|
|
fontSize: normalize(18),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
textInputMail: {
|
|
|
|
textInputMail: {
|
|
|
|
marginLeft: 100,
|
|
|
|
marginLeft: 100,
|
|
|
|
color: 'white',
|
|
|
|
color: style.Text,
|
|
|
|
width: '57%',
|
|
|
|
width: '57%',
|
|
|
|
fontSize: normalize(18)
|
|
|
|
fontSize: normalize(18)
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -288,7 +281,7 @@ export default function SettingProfil() {
|
|
|
|
<View style={styles.profilHead}>
|
|
|
|
<View style={styles.profilHead}>
|
|
|
|
<Text style={styles.title}>Profil</Text>
|
|
|
|
<Text style={styles.title}>Profil</Text>
|
|
|
|
<View style={styles.imageWrapper}>
|
|
|
|
<View style={styles.imageWrapper}>
|
|
|
|
{image && <Image source={{ uri: image }} style={styles.imageProfil} />}
|
|
|
|
<Image source={{ uri: UserCurrent.image }} style={styles.imageProfil} />
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
<View style={styles.editButton}>
|
|
|
|
<View style={styles.editButton}>
|
|
|
|
<TouchableOpacity onPress={pickImage} >
|
|
|
|
<TouchableOpacity onPress={pickImage} >
|
|
|
@ -301,11 +294,11 @@ export default function SettingProfil() {
|
|
|
|
<View style={styles.body}>
|
|
|
|
<View style={styles.body}>
|
|
|
|
<View style={styles.optionId}>
|
|
|
|
<View style={styles.optionId}>
|
|
|
|
<Text style={styles.textOption}>Identifiant</Text>
|
|
|
|
<Text style={styles.textOption}>Identifiant</Text>
|
|
|
|
<TextInput placeholderTextColor='#828288' placeholder='Flady' style={styles.textInputId} />
|
|
|
|
<TextInput placeholderTextColor='#828288' placeholder={UserCurrent.name} style={styles.textInputId} />
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
<View style={styles.optionMail}>
|
|
|
|
<View style={styles.optionMail}>
|
|
|
|
<Text style={styles.textOption}>Mail</Text>
|
|
|
|
<Text style={styles.textOption}>Mail</Text>
|
|
|
|
<TextInput placeholderTextColor='#828288' placeholder='emre.kartal@etu.uca.fr' style={styles.textInputMail} />
|
|
|
|
<TextInput placeholderTextColor='#828288' placeholder={UserCurrent.email} style={styles.textInputMail} />
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
|
|