Commit 58621ff6 by Nguyễn Hải Tùng

Done Feedback screen

parent c2e7556c
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
D10F3A5D59847BD5B121672E /* [CP] Embed Pods Frameworks */, D10F3A5D59847BD5B121672E /* [CP] Embed Pods Frameworks */,
6CC873A1E6FA7C328D7B37A9 /* ShellScript */, 6CC873A1E6FA7C328D7B37A9 /* ShellScript */,
383CE6D0253EBDFD9034AB15 /* [CP] Copy Pods Resources */, 7407C6B05E2A16BC3AEF8BEA /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
...@@ -495,7 +495,7 @@ ...@@ -495,7 +495,7 @@
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
}; };
50AA96423ADD3C77C5478E40 /* [CP] Embed Pods Frameworks */ = { 50AA96423ADD3C77C5478E40 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
...@@ -513,7 +513,7 @@ ...@@ -513,7 +513,7 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Invest-InvestTests/Pods-Invest-InvestTests-frameworks.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Invest-InvestTests/Pods-Invest-InvestTests-frameworks.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
6CC873A1E6FA7C328D7B37A9 /* ShellScript */ = { 6CC873A1E6FA7C328D7B37A9 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
...@@ -543,6 +543,58 @@ ...@@ -543,6 +543,58 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Invest/Pods-Invest-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Invest/Pods-Invest-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
7407C6B05E2A16BC3AEF8BEA /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Invest/Pods-Invest-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Feather.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Foundation.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Octicons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Zocial.ttf",
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Feather.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Brands.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Regular.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Solid.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Fontisto.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Foundation.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Ionicons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialCommunityIcons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialIcons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Octicons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SimpleLineIcons.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Zocial.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Invest/Pods-Invest-resources.sh\"\n";
showEnvVarsInLog = 0;
};
AA0D418EA141E60BA49CB685 /* [CP] Copy Pods Resources */ = { AA0D418EA141E60BA49CB685 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
......
...@@ -7,6 +7,9 @@ import { ...@@ -7,6 +7,9 @@ import {
Platform, Platform,
TextInput, TextInput,
Image, Image,
TouchableOpacity,
ImageBackground,
ScrollView,
} from 'react-native'; } from 'react-native';
import HeaderBack from '../../components/Header/HeaderBack'; import HeaderBack from '../../components/Header/HeaderBack';
import RadioForm, { import RadioForm, {
...@@ -16,6 +19,8 @@ import RadioForm, { ...@@ -16,6 +19,8 @@ import RadioForm, {
} from 'react-native-simple-radio-button'; } from 'react-native-simple-radio-button';
import PickerImg from '../../components/Picker/PickerImg'; import PickerImg from '../../components/Picker/PickerImg';
import {HEIGHTXD, WIDTHXD, getFontXD} from '../../Config/Functions'; import {HEIGHTXD, WIDTHXD, getFontXD} from '../../Config/Functions';
import R from '../../assets/R';
import Button from '../../components/Button';
const radio_props = [ const radio_props = [
{label: 'Rất kém', value: 0}, {label: 'Rất kém', value: 0},
...@@ -28,17 +33,26 @@ const radio_props = [ ...@@ -28,17 +33,26 @@ const radio_props = [
const FeedbackView = (props) => { const FeedbackView = (props) => {
const [isSelected, setIsSelected] = useState(''); const [isSelected, setIsSelected] = useState('');
const [txtInput, setTxtInput] = useState(''); const [txtInput, setTxtInput] = useState('');
const [url, setUrl] = useState(''); const [imageAdd, setImageAdd] = useState([]);
const onPress = (value) => { const onPress = (value) => {
setIsSelected(value); setIsSelected(value);
// console.log('hellooo'); // console.log('hellooo');
}; };
const onClickImage = (path) => { const onClickImages = (images) => {
setUrl(path); // const images = imageAdd.map((e) => e.path);
console.log('path--', path); setImageAdd(images);
}; };
const onClickClose = (index) => {
console.log('index---', index);
const temp = imageAdd.filter((e, i) => {
if (i != index) return e;
});
setImageAdd(temp);
};
return ( return (
<KeyboardAvoidingView <KeyboardAvoidingView
behavior={Platform.Os === 'ios' ? 'padding' : 'height'} behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
...@@ -57,9 +71,8 @@ const FeedbackView = (props) => { ...@@ -57,9 +71,8 @@ const FeedbackView = (props) => {
index={i} index={i}
isSelected={isSelected === i} isSelected={isSelected === i}
onPress={onPress} onPress={onPress}
r
borderWidth={1} borderWidth={1}
// buttonInnerColor={'#1473E6'}
// buttonOuterColor={isSelected === i ? '#1473E6' : '#000'}
buttonColor={isSelected === i ? '#1473E6' : '#C5C5C5'} buttonColor={isSelected === i ? '#1473E6' : '#C5C5C5'}
buttonSize={10} buttonSize={10}
buttonOuterSize={18} buttonOuterSize={18}
...@@ -90,21 +103,48 @@ const FeedbackView = (props) => { ...@@ -90,21 +103,48 @@ const FeedbackView = (props) => {
borderColor: '#CBCBCB', borderColor: '#CBCBCB',
}} }}
/> />
<View> <View style={styles.picker}>
{url ? ( {imageAdd.length > 0 ? (
<Image <ScrollView showsHorizontalScrollIndicator={false} horizontal>
style={{ {imageAdd.map((e, index) => (
width: WIDTHXD(350), <View key={index} style={styles.imageButton}>
height: HEIGHTXD(250), <ImageBackground
}} imageStyle={{
source={{uri: url}} width: WIDTHXD(330),
/> height: HEIGHTXD(250),
}}
style={{
width: WIDTHXD(330),
height: HEIGHTXD(250),
}}
source={{uri: e}}>
<TouchableOpacity
style={{
flexDirection: 'row',
justifyContent: 'flex-end',
marginTop: -10,
marginRight: -10,
}}
onPress={() => onClickClose(index)}>
<Image
style={{height: 30, width: 30}}
source={R.images.iconClose}
/>
</TouchableOpacity>
</ImageBackground>
</View>
))}
</ScrollView>
) : ( ) : (
<PickerImg title="Tải ảnh lên" onClickImage={onClickImage} /> <PickerImg title="Tải ảnh lên" onClickImage={onClickImages} />
)} )}
</View> </View>
</View> </View>
</View> </View>
<View style={styles.containerBtn}>
<Button onClick={() => console.log('hello')} title={'Gửi feedback'} />
</View>
</View> </View>
</KeyboardAvoidingView> </KeyboardAvoidingView>
); );
...@@ -133,6 +173,17 @@ const styles = StyleSheet.create({ ...@@ -133,6 +173,17 @@ const styles = StyleSheet.create({
height: 110, height: 110,
margin: 10, margin: 10,
}, },
picker: {
marginLeft: 10,
marginBottom: 10,
},
imageButton: {
marginTop: 10,
marginRight: 20,
},
containerBtn: {
marginBottom: 30,
},
}); });
export default FeedbackView; export default FeedbackView;
...@@ -31,6 +31,7 @@ const images = { ...@@ -31,6 +31,7 @@ const images = {
iconDepositNoti: require('./images/iconDeposit.png'), iconDepositNoti: require('./images/iconDeposit.png'),
iconRecharge: require('./images/iconRecharge.png'), iconRecharge: require('./images/iconRecharge.png'),
iconWithdrawal: require('./images/iconWithdrawal.png'), iconWithdrawal: require('./images/iconWithdrawal.png'),
iconClose: require('./images/CloseIcon.png'),
iconBack: require('./images/iconBack.png'), iconBack: require('./images/iconBack.png'),
bgBtn: require('./images/bgBtn.png'), bgBtn: require('./images/bgBtn.png'),
addImg: require('./images/addImg.png'), addImg: require('./images/addImg.png'),
......
...@@ -36,8 +36,9 @@ const PickerImg = (props) => { ...@@ -36,8 +36,9 @@ const PickerImg = (props) => {
multiple: true, multiple: true,
}).then((images) => { }).then((images) => {
setModalVisible(false); setModalVisible(false);
console.log(images); console.log('images---', images);
onClickImage(images[0].path); const temp = images.map((e) => e.path);
onClickImage(temp);
}); });
}; };
......
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