Skip to content

Commit 7121538

Browse files
committed
Updation for new journal UI
1 parent a706213 commit 7121538

2 files changed

Lines changed: 32 additions & 9 deletions

File tree

src/components/InputText.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,22 @@ import { color } from '../styles';
77

88
export default function InputText(props) {
99
const {
10-
name, value, meta, style, onChangeInputValue, isMandatory
10+
name, value, meta, style, onChangeInputValue, isMandatory, imgView, inputStyle
1111
} = props;
1212

1313
return (
14-
<View key={name}>
15-
<Text style={[styles.text, meta.textStyle]}>{`${meta.label} ${isMandatory ? '*' : ''}`}</Text>
14+
<View key={name} style={[meta.containerStyle ,{}]}>
15+
{imgView ?
16+
<View style={styles.yellowMainView}>
17+
{imgView()}
18+
<View style={styles.yellowView}>
19+
<Text style={[styles.text, styles.yellowTxt]}>{`${meta.label} ${isMandatory ? '*' : ''}`}</Text>
20+
</View>
21+
</View> :
22+
<Text style={[styles.text, meta.textStyle]}>{`${meta.label} ${isMandatory ? '*' : ''}`}</Text>
23+
}
1624
<TextInput
17-
style={{ ...styles.textBox(meta.multiline, meta.numberOfLines), ...style }}
25+
style={{ ...styles.textBox(meta.multiline, meta.numberOfLines), ...style, ...inputStyle }}
1826
value={value || ''}
1927
underlineColorAndroid="transparent"
2028
onChangeText={onChangeInputValue}
@@ -41,6 +49,21 @@ const styles = StyleSheet.create({
4149
margin: 10,
4250
paddingLeft: 10
4351
}),
52+
yellowMainView: {
53+
flexDirection: 'row',
54+
},
55+
yellowView: {
56+
backgroundColor: '#FDDE02',
57+
paddingHorizontal: 16,
58+
paddingVertical: 12,
59+
borderRadius: 20,
60+
borderTopLeftRadius: 0,
61+
width: '75%',
62+
marginLeft: 10,
63+
},
64+
yellowTxt: {
65+
color: 'black',
66+
}
4467
});
4568

4669
InputText.propTypes = {

src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ import { Button } from 'react-native-elements';
77
import { componentName, skipValidationForFields } from './constant';
88
import { getComponent, getValidator } from './componentMap';
99

10-
11-
12-
13-
1410
const DynamicForm = React.forwardRef(
1511
({
16-
formTemplate, onSubmit, buttonStyles, hideButtons=false, formValues = null, isTherapistQuestionnaire = true
12+
formTemplate, onSubmit, buttonStyles, hideButtons=false, formValues = null, isTherapistQuestionnaire = true,
13+
imgView,
14+
inputStyle
1715
}, ref) =>
1816
{
1917

@@ -132,6 +130,8 @@ const DynamicForm = React.forwardRef(
132130
value={getValue(element)}
133131
onChangeInputValue={onChangeInputValue(element.field_name, element.component)}
134132
isMandatory={element.is_mandatory === 'true'}
133+
imgView={imgView}
134+
inputStyle={inputStyle}
135135
/>
136136
);
137137
})

0 commit comments

Comments
 (0)