Skip to content

Commit

Permalink
feat: add text question above input PIP question
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-mccombs committed Nov 19, 2020
1 parent 3c632c6 commit 66bbd69
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions components/FormikFields/PaperInputPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,26 @@ const PaperInputPicker = ({
</Text>
</View>
)}
{fieldType === 'inputSideLabelTextQuestNumber' && (
<View style={styles}>
<Text>{translatedLabel}</Text>
<View style={{ flexDirection: 'row' }}>
<TextInput
onChangeText={handleChange(formikKey)}
onBlur={handleBlur(formikKey)}
{...rest} //eslint-disable-line
mode="outlined"
keyboardType="numeric"
theme={{ colors: { placeholder: theme.colors.primary }, text: 'black' }}
style={{ flex: 1 }}
/>
<Text style={styleX.sideLabel}>{translatedLabelSide}</Text>
</View>
<Text style={{ color: 'red' }}>
{errors[formikKey]}
</Text>
</View>
)}
{fieldType === 'inputSideBySideLabel' && (
<View style={styles}>
<View style={{ flexDirection: 'row' }}>
Expand Down Expand Up @@ -250,7 +270,7 @@ const PaperInputPicker = ({
{errors[result.textKey]}
</Text>
</View>
)}
)}
</View>
))}
<Text style={{ color: 'red' }}>
Expand Down Expand Up @@ -329,20 +349,20 @@ const PaperInputPicker = ({
<Text style={styleX.textSplit}>{result.label}</Text>
</View>
) : (
<View key={result.value} style={styles.inputItem}>
<TextInput
label={customForm ? result.label : I18n.t(result.label)}
onChangeText={handleChange(customForm ? result.label : I18n.t(result.label))}
onBlur={handleBlur(customForm ? result.label : I18n.t(result.label))}
<View key={result.value} style={styles.inputItem}>
<TextInput
label={customForm ? result.label : I18n.t(result.label)}
onChangeText={handleChange(customForm ? result.label : I18n.t(result.label))}
onBlur={handleBlur(customForm ? result.label : I18n.t(result.label))}
{...rest} //eslint-disable-line
mode="outlined"
theme={{ colors: { placeholder: theme.colors.primary }, text: 'black' }}
/>
<Text style={{ color: 'red' }}>
{errors[customForm ? result.label : I18n.t(result.label)]}
</Text>
</View>
)))}
mode="outlined"
theme={{ colors: { placeholder: theme.colors.primary }, text: 'black' }}
/>
<Text style={{ color: 'red' }}>
{errors[customForm ? result.label : I18n.t(result.label)]}
</Text>
</View>
)))}
</View>
</View>
)}
Expand Down

0 comments on commit 66bbd69

Please sign in to comment.