Commit 004b1ebd by Giang Tran

update api avatart

parent 5737da63
...@@ -903,7 +903,7 @@ ...@@ -903,7 +903,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements; CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
...@@ -937,7 +937,7 @@ ...@@ -937,7 +937,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements; CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
INFOPLIST_FILE = Invest/Info.plist; INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
<string>$(MARKETING_VERSION)</string> <string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>UIRequiresFullScreen</key>
<true/>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
<array> <array>
<dict> <dict>
......
...@@ -11,13 +11,15 @@ import _ from 'lodash'; ...@@ -11,13 +11,15 @@ import _ from 'lodash';
import I18n from '../helper/i18/i18n'; import I18n from '../helper/i18/i18n';
import AppText from '../components/AppText'; import AppText from '../components/AppText';
import {DETAILNEW, NOTIFICATION} from '../routers/ScreenNames'; import {DETAILNEW, TABNAVIGATOR} from '../routers/ScreenNames';
import R from '../assets/R'; import R from '../assets/R';
export const convertScreen = (name) => { export const convertScreen = (name) => {
switch (name) { switch (name) {
case 'CUSTOMER_NEWS': case 'CUSTOMER_NEWS':
return DETAILNEW; return DETAILNEW;
case 'CUSTOMER_NOTIFICATION':
return TABNAVIGATOR;
default: default:
return DETAILNEW; return DETAILNEW;
} }
......
...@@ -8,27 +8,199 @@ import I18n from '../../helper/i18/i18n'; ...@@ -8,27 +8,199 @@ import I18n from '../../helper/i18/i18n';
import HomeView from './HomeView'; import HomeView from './HomeView';
import {getListCategoryProduct} from '../../apis/Functions/Transaction'; import {getListCategoryProduct} from '../../apis/Functions/Transaction';
const Home = (props) => { const Home = (props) => {
console.log(props.user);
const [data, setData] = useState({total_deposit: 0, total_withdraw: 0}); const [data, setData] = useState({total_deposit: 0, total_withdraw: 0});
const [dataPrice, setDataPrice] = useState([ const [dataPrice, setDataPrice] = useState([
{name: 'GCEM21', change: 0.2, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, {
{name: 'GCEM21', change: 0.5, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, name: 'GCEM21',
{name: 'GCEM21', change: 0.1, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, change: 0.2,
{name: 'GCEM21', change: 0.6, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, changePercent: 0.1,
{name: 'GCEM21', change: 0.3, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, openPrice: 1777.2,
{name: 'GCEM21', change: 0.9, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, closePrice: 17778.3,
{name: 'GCEM21', change: 0.2, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, highPrice: 1778.9,
{name: 'GCEM21', change: 0.3, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, lowPrice: 1777,
{name: 'GCEM21', change: 0.5, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, time: 'Gold (Globex): June 2021',
{name: 'GCEM21', change: 0.1, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, },
{name: 'GCEM21', change: 0.7, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, {
{name: 'GCEM21', change: 0.4, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, name: 'GCEM21',
{name: 'GCEM21', change: 0.5, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, change: 0.5,
{name: 'GCEM21', change: 0.5, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, changePercent: 0.1,
{name: 'GCEM21', change: 0.8, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, openPrice: 1777.2,
{name: 'GCEM21', change: 0.3, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, closePrice: 17778.3,
{name: 'GCEM21', change: 0.4, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, highPrice: 1778.9,
{name: 'GCEM21', change: 0.5, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, lowPrice: 1777,
{name: 'GCEM21', change: 0.4, changePercent: 0.1, openPrice: 1777.2, closePrice: 17778.3, highPrice: 1778.9, lowPrice: 1777, time: 'Gold (Globex): June 2021'}, time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.1,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.6,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.3,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.9,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.2,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.3,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.5,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.1,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.7,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.4,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.5,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.5,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.8,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.3,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.4,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.5,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
{
name: 'GCEM21',
change: 0.4,
changePercent: 0.1,
openPrice: 1777.2,
closePrice: 17778.3,
highPrice: 1778.9,
lowPrice: 1777,
time: 'Gold (Globex): June 2021',
},
]); ]);
const [listImage, setListImage] = useState([]); const [listImage, setListImage] = useState([]);
const [filters, setFilters] = useState([]); const [filters, setFilters] = useState([]);
...@@ -36,15 +208,19 @@ const Home = (props) => { ...@@ -36,15 +208,19 @@ const Home = (props) => {
useEffect(() => { useEffect(() => {
getData(); getData();
let io = require('socket.io-client'); let io = require('socket.io-client');
let socket = io.connect('http://222.252.22.174:8087', { transports: ['websocket'], jsonp: false, reconnect: true }); let socket = io.connect('http://222.252.22.174:8087', {
transports: ['websocket'],
jsonp: false,
reconnect: true,
});
socket.on('response-update-price', (message) => { socket.on('response-update-price', (message) => {
console.log('received message', message) console.log('received message', message);
}); });
}, []); }, []);
const onReceivedMessage = (message) => { const onReceivedMessage = (message) => {
console.log(message) console.log(message);
} };
const getData = async () => { const getData = async () => {
const res = await getTransaction({}); const res = await getTransaction({});
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
...@@ -66,7 +242,7 @@ const Home = (props) => { ...@@ -66,7 +242,7 @@ const Home = (props) => {
page_index: 1, page_index: 1,
type: 'PRODUCT', type: 'PRODUCT',
}); });
console.log(resCategoryProduct) console.log(resCategoryProduct);
if ((resCategoryProduct.data.code = 200 && resCategoryProduct.data.data)) { if ((resCategoryProduct.data.code = 200 && resCategoryProduct.data.data)) {
let data = []; let data = [];
data.push({id: -1, name: 'All'}); data.push({id: -1, name: 'All'});
...@@ -76,14 +252,16 @@ const Home = (props) => { ...@@ -76,14 +252,16 @@ const Home = (props) => {
} }
}; };
return <HomeView return (
<HomeView
data={data} data={data}
dataPrice={dataPrice} dataPrice={dataPrice}
listImage={listImage} listImage={listImage}
filterId={filterId} filterId={filterId}
filters={filters} filters={filters}
setFilterId={setFilterId} setFilterId={setFilterId}
/>; />
);
}; };
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
......
...@@ -24,7 +24,9 @@ const HomeView = (props) => { ...@@ -24,7 +24,9 @@ const HomeView = (props) => {
<HeaderHome /> <HeaderHome />
{props.listImage.length > 0 ? ( {props.listImage.length > 0 ? (
<SwiperComponent listImage={props.listImage} /> <SwiperComponent listImage={props.listImage} />
) : null} ) : (
<View style={{height: 10}} />
)}
<PriceListView <PriceListView
setFilterId={props.setFilterId} setFilterId={props.setFilterId}
filterId={props.filterId} filterId={props.filterId}
......
...@@ -9,6 +9,7 @@ const styles = StyleSheet.create({ ...@@ -9,6 +9,7 @@ const styles = StyleSheet.create({
container: { container: {
marginHorizontal: 20, marginHorizontal: 20,
marginBottom: 10, marginBottom: 10,
borderRadius: 5,
height: HEIGHTXD(400), height: HEIGHTXD(400),
marginTop: 25, marginTop: 25,
...@@ -42,21 +43,21 @@ const SwiperComponent = (props) => { ...@@ -42,21 +43,21 @@ const SwiperComponent = (props) => {
autoplay={true}> autoplay={true}>
<View style={{borderRadius: 10}}> <View style={{borderRadius: 10}}>
<Image <Image
style={{height: HEIGHTXD(400), width: '100%', borderRadius: 10}} style={{height: HEIGHTXD(400), width: '100%', borderRadius: 5}}
source={{uri: props.listImage[0].url}} source={{uri: props.listImage[0].url}}
resizeMode={'cover'} resizeMode={'cover'}
/> />
</View> </View>
<View style={{borderRadius: 10}}> <View style={{borderRadius: 10}}>
<Image <Image
style={{height: HEIGHTXD(400), width: '100%', borderRadius: 10}} style={{height: HEIGHTXD(400), width: '100%', borderRadius: 5}}
source={{uri: props.listImage[1].url}} source={{uri: props.listImage[1].url}}
resizeMode={'cover'} resizeMode={'cover'}
/> />
</View> </View>
<View style={{borderRadius: 10}}> <View style={{borderRadius: 10}}>
<Image <Image
style={{height: HEIGHTXD(400), width: '100%', borderRadius: 10}} style={{height: HEIGHTXD(400), width: '100%', borderRadius: 5}}
source={{uri: props.listImage[2].url}} source={{uri: props.listImage[2].url}}
resizeMode={'cover'} resizeMode={'cover'}
/> />
......
...@@ -61,3 +61,8 @@ export const getNewestVersionInfo = async (body) => ...@@ -61,3 +61,8 @@ export const getNewestVersionInfo = async (body) =>
GetData(url.urlGetNewestVersionInfo, body) GetData(url.urlGetNewestVersionInfo, body)
.then((res) => res) .then((res) => res)
.catch((err) => err); .catch((err) => err);
export const changeAvatart = async (body) =>
PostFormData(url.urlChangeAvatar, body)
.then((res) => res)
.catch((err) => err);
...@@ -43,4 +43,6 @@ export default { ...@@ -43,4 +43,6 @@ export default {
//Transaction //Transaction
urlGetTransactionListByCategory: `${root}api/v1/transactions/products`, urlGetTransactionListByCategory: `${root}api/v1/transactions/products`,
urlGetContractDescription: `${root}api/v1/transactions/products/specification-contract/`, urlGetContractDescription: `${root}api/v1/transactions/products/specification-contract/`,
urlChangeAvatar: root + 'api/v1/customers/update-avatar',
}; };
...@@ -86,6 +86,7 @@ const images = { ...@@ -86,6 +86,7 @@ const images = {
iconHistoryMenu: require('./images/iconHistoryMenu1.png'), iconHistoryMenu: require('./images/iconHistoryMenu1.png'),
iconProfileMenu: require('./images/iconProfileMenu.png'), iconProfileMenu: require('./images/iconProfileMenu.png'),
iconUpgrade: require('./images/iconUpgrade.png'), iconUpgrade: require('./images/iconUpgrade.png'),
imagePicker: require('./images/imagePicker.png'),
}; };
export default images; export default images;
...@@ -33,7 +33,7 @@ import { ...@@ -33,7 +33,7 @@ import {
WALLETWITHDRAW, WALLETWITHDRAW,
PACKETCQG, PACKETCQG,
} from '../../routers/ScreenNames'; } from '../../routers/ScreenNames';
import PickerAvtart from '../../components/Picker/PickerAvatart';
const renderWallet = (status, current_money, current_cqg_money, contract) => { const renderWallet = (status, current_money, current_cqg_money, contract) => {
const navigate = useNavigation(); const navigate = useNavigation();
if (status == 6) if (status == 6)
...@@ -192,6 +192,10 @@ const HeaderHome = (props) => { ...@@ -192,6 +192,10 @@ const HeaderHome = (props) => {
setDetail(!detail); setDetail(!detail);
}; };
const onClickImage = (path) => {
console.log(path);
};
const copyToClipboard = () => { const copyToClipboard = () => {
Alert.alert(I18n.t('Notification'), I18n.t('CopyLink')); Alert.alert(I18n.t('Notification'), I18n.t('CopyLink'));
Clipboard.setString(props.user.sponsor_url); Clipboard.setString(props.user.sponsor_url);
...@@ -209,7 +213,7 @@ const HeaderHome = (props) => { ...@@ -209,7 +213,7 @@ const HeaderHome = (props) => {
}}> }}>
<View style={styles.containerTop}> <View style={styles.containerTop}>
<View style={styles.containerInfor}> <View style={styles.containerInfor}>
<Image source={R.images.avartar} style={styles.imgAvatar} /> <PickerAvtart onClickImage={onClickImage} />
<View style={styles.wrapRight}> <View style={styles.wrapRight}>
<TouchableOpacity onPress={() => navigate.navigate(PROFILE)}> <TouchableOpacity onPress={() => navigate.navigate(PROFILE)}>
<View style={{flexDirection: 'row', alignItems: 'center'}}> <View style={{flexDirection: 'row', alignItems: 'center'}}>
...@@ -375,6 +379,16 @@ const styles = StyleSheet.create({ ...@@ -375,6 +379,16 @@ const styles = StyleSheet.create({
height: WIDTHXD(180), height: WIDTHXD(180),
borderRadius: WIDTHXD(90), borderRadius: WIDTHXD(90),
}, },
containerImg: {
width: WIDTHXD(180),
height: WIDTHXD(180),
backgroundColor: 'red',
},
iconImg: {
position: 'absolute',
bottom: 0,
right: 0,
},
txtMoney: { txtMoney: {
fontSize: getFontXD(62), fontSize: getFontXD(62),
color: '#FFB721', color: '#FFB721',
......
import React, {useState, useEffect} from 'react';
import {
View,
Text,
Image,
StyleSheet,
TouchableOpacity,
TouchableWithoutFeedback,
Platform,
Alert,
} from 'react-native';
import R from '../../assets/R';
import {HEIGHTXD, WIDTHXD, getFontXD} from '../../Config/Functions';
import Icon from 'react-native-vector-icons/AntDesign';
import Modal from 'react-native-modal';
import Block from '../Block';
import ImagePicker from 'react-native-image-crop-picker';
import AppText from '../AppText';
import {connect} from 'react-redux';
import {saveUserToRedux} from '../../actions/users';
import I18n from '../../helper/i18/i18n';
import {useNavigation} from '@react-navigation/native';
import {changeAvatart} from '../../apis/Functions/users';
const options = {
title: 'Select Avatar',
customButtons: [{name: 'fb', title: 'Choose Photo from Facebook'}],
storageOptions: {
skipBackup: true,
path: 'images',
},
};
const PickerImg = (props) => {
const naviagtion = useNavigation();
const [isModalVisible, setModalVisible] = useState(false);
const [imgAvatart, setImgAvatart] = useState(props.user.picture_url);
console.log(props.user);
useEffect(() => {
setTimeout(() => {
console.log('Affter', props.user.picture_url);
setImgAvatart(props.user.picture_url);
}, 500);
}, [props.user]);
const createFormData = (photo, body) => {
const data = new FormData();
data.append('avatar', {
name: 'sign_img.jpg',
type: 'image/jpg',
uri: Platform.OS === 'android' ? photo : photo.replace('file://', ''),
});
Object.keys(body).forEach((key) => {
data.append(key, body[key]);
});
return data;
};
const callApi = async (image) => {
const res = await changeAvatart(
createFormData(image, {uid: props.user.uid, platform: Platform.OS}),
);
if (res.data.code == 200) {
setTimeout(() => {
props.saveUserToRedux(res.data.data);
Alert.alert(I18n.t('Notification'), res.data.message);
}, 500);
} else {
setTimeout(() => {
Alert.alert(I18n.t('Notification'), res.data.message);
}, 500);
}
};
const onchoosGalery = () => {
ImagePicker.openPicker({
mediaType: 'photo',
multiple: false,
cropping: true,
width: 300,
height: 300,
}).then((image) => {
setModalVisible(false);
callApi(image.path);
});
};
const onCapture = () => {
ImagePicker.openCamera({
mediaType: 'photo',
multiple: false,
width: 300,
height: 300,
cropping: true,
}).then((image) => {
setModalVisible(false);
callApi(image.path);
});
};
return (
<TouchableOpacity onPress={() => setModalVisible(true)}>
<View style={styles.containerImg}>
<Image source={{uri: imgAvatart}} style={styles.imgAvatar} />
<View style={styles.iconPicker}>
<Image
style={{width: 20, height: 20}}
source={R.images.imagePicker}
/>
</View>
</View>
<Modal
isVisible={isModalVisible}
style={{margin: 0, justifyContent: 'flex-end'}}
onSwipeComplete={() => setModalVisible(false)}
swipeDirection={['up', 'left', 'right', 'down']}>
<TouchableWithoutFeedback onPress={() => setModalVisible(false)}>
<View style={{flex: 1}}></View>
</TouchableWithoutFeedback>
<View style={styles.containerSelect}>
<AppText
i18nKey={'Select_source_image'}
style={{
textAlign: 'center',
fontSize: getFontXD(42),
fontWeight: 'bold',
color: '#1473E6',
}}
/>
<View style={styles.line} />
<Block row space={'around'} center>
<TouchableOpacity style={styles.selectionImg} onPress={onCapture}>
<Image style={styles.imgIcon} source={R.images.iconCamera} />
<AppText i18nKey={'Take_photo'} style={styles.txtTitleBtn} />
</TouchableOpacity>
<TouchableOpacity
style={styles.selectionImg}
onPress={onchoosGalery}>
<Image style={styles.imgIcon} source={R.images.iconImg} />
<AppText i18nKey={'Photo_library'} style={styles.txtTitleBtn} />
</TouchableOpacity>
</Block>
</View>
</Modal>
</TouchableOpacity>
);
};
const styles = StyleSheet.create({
container: {
width: WIDTHXD(350),
height: HEIGHTXD(280),
backgroundColor: R.colors.white,
borderRadius: 10,
borderWidth: 2,
borderColor: '#DBDBDB',
borderStyle: 'dashed',
justifyContent: 'center',
alignItems: 'center',
},
txt: {
fontSize: getFontXD(42),
color: R.colors.color777,
marginBottom: 5,
paddingLeft: 10,
},
selectionImg: {
padding: 10,
justifyContent: 'center',
alignItems: 'center',
},
containerSelect: {
height: HEIGHTXD(520),
backgroundColor: 'white',
paddingTop: 10,
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
},
line: {
height: 1,
backgroundColor: '#929292',
width: '100%',
marginTop: 5,
},
imgIcon: {
width: 40,
height: 40,
},
txtTitleBtn: {
textAlign: 'center',
fontSize: getFontXD(42),
color: '#1473E6',
},
imgAvatar: {
width: WIDTHXD(180),
height: WIDTHXD(180),
borderRadius: WIDTHXD(90),
},
containerImg: {
width: WIDTHXD(180),
height: WIDTHXD(180),
},
iconPicker: {
position: 'absolute',
bottom: 0,
right: 0,
},
});
const mapStateToProps = (state) => {
return {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {saveUserToRedux})(PickerImg);
...@@ -35,6 +35,7 @@ const PickerImg = (props) => { ...@@ -35,6 +35,7 @@ const PickerImg = (props) => {
ImagePicker.openPicker({ ImagePicker.openPicker({
mediaType: 'photo', mediaType: 'photo',
multiple: true, multiple: true,
cropping: true,
}).then((images) => { }).then((images) => {
setModalVisible(false); setModalVisible(false);
...@@ -48,6 +49,7 @@ const PickerImg = (props) => { ...@@ -48,6 +49,7 @@ const PickerImg = (props) => {
mediaType: 'photo', mediaType: 'photo',
width: 300, width: 300,
height: 400, height: 400,
cropping: true,
}).then((image) => { }).then((image) => {
setModalVisible(false); setModalVisible(false);
......
...@@ -50,6 +50,7 @@ const PickerImgUni = (props) => { ...@@ -50,6 +50,7 @@ const PickerImgUni = (props) => {
ImagePicker.openPicker({ ImagePicker.openPicker({
mediaType: 'photo', mediaType: 'photo',
multiple: false, multiple: false,
cropping: true,
}).then((image) => { }).then((image) => {
setModalVisible(false); setModalVisible(false);
setUrlImg(image.path); setUrlImg(image.path);
...@@ -63,6 +64,7 @@ const PickerImgUni = (props) => { ...@@ -63,6 +64,7 @@ const PickerImgUni = (props) => {
mediaType: 'photo', mediaType: 'photo',
width: 300, width: 300,
height: 400, height: 400,
cropping: true,
}).then((image) => { }).then((image) => {
setModalVisible(false); setModalVisible(false);
setUrlImg(image.path); setUrlImg(image.path);
......
...@@ -38,8 +38,10 @@ const SnackBar = (props) => { ...@@ -38,8 +38,10 @@ const SnackBar = (props) => {
isVisible={isOpen}> isVisible={isOpen}>
<View style={styles.container}> <View style={styles.container}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<Text style={styles.txtTitle}>{title}</Text> <Text numberOfLines={1} style={styles.txtTitle}>
<Text numberOfLines={2} style={styles.txt}> {title}
</Text>
<Text numberOfLines={3} style={styles.txt}>
{content} {content}
</Text> </Text>
</View> </View>
......
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