From 34c86188316599cf88a124ee64bcde3cb968a4d6 Mon Sep 17 00:00:00 2001 From: "aman.singh" Date: Wed, 7 Dec 2022 17:58:13 +0530 Subject: [PATCH] cosmetic changes --- App.tsx | 13 +------ RN-UI-LIB | 2 +- .../form/components/ImageUpload.tsx | 35 ++++++++++++++++--- src/components/form/index.tsx | 21 ++++++++--- 4 files changed, 50 insertions(+), 21 deletions(-) diff --git a/App.tsx b/App.tsx index 737352c4..281e3289 100644 --- a/App.tsx +++ b/App.tsx @@ -1,15 +1,5 @@ -/** - * Sample React Native App - * https://github.com/facebook/react-native - * - * Generated with the TypeScript template - * https://github.com/react-native-community/react-native-template-typescript - * - * @format - */ - import React from 'react'; -import {SafeAreaView, Text, View} from 'react-native'; +import {SafeAreaView, View} from 'react-native'; import data from './src/data/templateData.json'; import userData from './src/data/userData.json'; import RenderingEngine from './src/components/formRenderingEngine'; @@ -21,7 +11,6 @@ import {NavigationContainer} from '@react-navigation/native'; import {createNativeStackNavigator} from '@react-navigation/native-stack'; import Widget from './src/components/form'; import {navigationRef} from './src/components/utlis/navigationUtlis'; -import {GenericStyles} from './RN-UI-LIB/src/styles'; import FullScreenLoader from './RN-UI-LIB/src/components/FullScreenLoader'; function HomeScreen() { diff --git a/RN-UI-LIB b/RN-UI-LIB index 92c6ab31..00b3263a 160000 --- a/RN-UI-LIB +++ b/RN-UI-LIB @@ -1 +1 @@ -Subproject commit 92c6ab3156943408d908a98c4ba30a42385fff16 +Subproject commit 00b3263a1a655c8ac2d4821d3f66a2c14d6889b8 diff --git a/src/components/form/components/ImageUpload.tsx b/src/components/form/components/ImageUpload.tsx index eb524217..137e3d87 100644 --- a/src/components/form/components/ImageUpload.tsx +++ b/src/components/form/components/ImageUpload.tsx @@ -1,4 +1,11 @@ -import {Image, StyleSheet, Text, View} from 'react-native'; +import { + Image, + ImageBackground, + Pressable, + StyleSheet, + Text, + View, +} from 'react-native'; import React, {useEffect} from 'react'; import {Control, Controller} from 'react-hook-form'; import CameraClickPicture from '../../../../RN-UI-LIB/src/components/camera_click_picture/CameraClickPicture'; @@ -9,6 +16,8 @@ import {useState} from 'react'; import {useSelector} from 'react-redux'; import {RootState} from '../../../store/store'; import ErrorMessage from './ErrorMessage'; +import DeleteIcon from '../../../../RN-UI-LIB/src/Icons/DeleteIcon'; +import {COLORS} from '../../../../RN-UI-LIB/src/styles/colors'; interface IImageUpload { questionType: string; @@ -44,7 +53,7 @@ const ImageUpload: React.FC = props => { } return ( - + {question.text}{' '} {question.type === 'mandatory' && ( * @@ -69,8 +78,13 @@ const ImageUpload: React.FC = props => { /> ) : ( - setImage('')}>delete - + + setImage('')} + style={styles.deleteButton}> + + + )} @@ -86,6 +100,19 @@ const styles = StyleSheet.create({ borderWidth: 1, borderColor: 'red', }, + deleteButton: { + position: 'absolute', + right: 8, + top: 8, + backgroundColor: COLORS.BACKGROUND.PRIMARY, + height: 28, + width: 28, + borderRadius: 14, + justifyContent: 'center', + alignItems: 'center', + borderWidth: 1, + borderColor: COLORS.BORDER.PRIMARY, + }, }); export default ImageUpload; diff --git a/src/components/form/index.tsx b/src/components/form/index.tsx index b709cad8..a718544e 100644 --- a/src/components/form/index.tsx +++ b/src/components/form/index.tsx @@ -1,3 +1,4 @@ +import ArrowBackSolidIcon from '../../../RN-UI-LIB/src/Icons/ArrowBackSolidIcon'; import React, {useState} from 'react'; import {useForm} from 'react-hook-form'; import {Pressable, ScrollView, StyleSheet, View} from 'react-native'; @@ -178,11 +179,14 @@ const Widget = (props: any) => { paddingHorizontal: 16, }}> - navigateToScreen('Home')}> + navigateToScreen('Home')}> - + Add feedback for Kunal Communication address @@ -229,9 +233,15 @@ const Widget = (props: any) => { GenericStyles.p16, styles.borderTop, ]}> -