Skip to content

Commit

Permalink
fix(exoflex): make TextInput label optional (#177)
Browse files Browse the repository at this point in the history
* fix(exoflex): make TextInput label optional

* chore(exoflex): add TextInput example without label
  • Loading branch information
oshimayoan committed Nov 2, 2019
1 parent 0352647 commit 5998f44
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/exoflex/example/src/examples/TextInputExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ function TextInputExample() {
placeholder="Hint Text"
containerStyle={{ marginVertical: 10 }}
/>
<TextInput
placeholder="Type here..."
containerStyle={{ marginVertical: 10 }}
/>
<TextInput
label="Input Label (Disabled)"
value="Input Text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ function TextInputOutlined(
? colors.accent
: colors.border,
backgroundColor: disabled ? colors.disabled : colors.surface,
justifyContent: !!label ? 'space-between' : 'center',
},
containerStyle,
]}
>
<Label style={labelStyle}>{label}</Label>
{!!label && <Label style={labelStyle}>{label}</Label>}
<TextInput
ref={ref}
editable={!disabled && editable}
Expand Down Expand Up @@ -86,7 +87,6 @@ let styles = StyleSheet.create({
height: 60,
padding: 12,
paddingVertical: 10,
justifyContent: 'space-between',
},
errorIcon: {
position: 'absolute',
Expand Down
2 changes: 1 addition & 1 deletion packages/exoflex/src/components/TextInput/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type TextInputProps = BaseTextInputProps & {
/**
* Label for the text input
*/
label: string;
label?: string;
/**
* When set to true, will disable all interaction with the text input
* Defaults to 'false'.
Expand Down

0 comments on commit 5998f44

Please sign in to comment.