Commit dfa0a536 by Giang Tran

fix image

parent 0b6c1cb8
......@@ -36,7 +36,7 @@ const options = {
const PickerImg = (props) => {
const naviagtion = useNavigation();
const [isModalVisible, setModalVisible] = useState(false);
// const [imgAvatart, setImgAvatart] = useState(props.user.picture_url);
const [imgAvatart, setImgAvatart] = useState(props.user.picture_url);
// useEffect(() => {
// setTimeout(() => {
......@@ -70,6 +70,7 @@ const PickerImg = (props) => {
Alert.alert(I18n.t('Notification'), res.data.message);
}, 500);
} else {
setImgAvatart(props.user.picture_url);
setTimeout(() => {
Alert.alert(I18n.t('Notification'), res.data.message);
}, 500);
......@@ -86,6 +87,7 @@ const PickerImg = (props) => {
}).then((image) => {
setModalVisible(false);
callApi(image.path);
setImgAvatart(image.path);
});
};
......@@ -99,16 +101,14 @@ const PickerImg = (props) => {
}).then((image) => {
setModalVisible(false);
callApi(image.path);
setImgAvatart(image.path);
});
};
return (
<TouchableOpacity onPress={() => setModalVisible(true)}>
<View style={styles.containerImg}>
{props.user.picture_url ? (
<Image
source={{uri: props.user.picture_url}}
style={styles.imgAvatar}
/>
{imgAvatart ? (
<Image source={{uri: imgAvatart}} style={styles.imgAvatar} />
) : (
<View style={styles.imgAvatar} />
)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment