diff options
author | 2019-04-11 12:00:07 +0200 | |
---|---|---|
committer | 2019-04-11 12:00:07 +0200 | |
commit | e43d6bd80b3d76aae627fa8174eea98c14016549 (patch) | |
tree | de1d0a3ba10100ce68d0cb1ed618095e362fe573 /packages/forms/src/label/index.tsx | |
parent | implements basic release announcement feature (diff) | |
parent | handle deleted services that are attached to workspaces (diff) | |
download | ferdium-app-e43d6bd80b3d76aae627fa8174eea98c14016549.tar.gz ferdium-app-e43d6bd80b3d76aae627fa8174eea98c14016549.tar.zst ferdium-app-e43d6bd80b3d76aae627fa8174eea98c14016549.zip |
merge-in workspace feature
Diffstat (limited to 'packages/forms/src/label/index.tsx')
-rw-r--r-- | packages/forms/src/label/index.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/forms/src/label/index.tsx b/packages/forms/src/label/index.tsx index 36fcfbedf..1b33ba22c 100644 --- a/packages/forms/src/label/index.tsx +++ b/packages/forms/src/label/index.tsx | |||
@@ -9,6 +9,7 @@ import styles from './styles'; | |||
9 | 9 | ||
10 | interface ILabel extends IFormField, React.LabelHTMLAttributes<HTMLLabelElement> { | 10 | interface ILabel extends IFormField, React.LabelHTMLAttributes<HTMLLabelElement> { |
11 | classes: Classes; | 11 | classes: Classes; |
12 | isRequired: boolean; | ||
12 | } | 13 | } |
13 | 14 | ||
14 | class LabelComponent extends Component<ILabel> { | 15 | class LabelComponent extends Component<ILabel> { |
@@ -24,8 +25,11 @@ class LabelComponent extends Component<ILabel> { | |||
24 | className, | 25 | className, |
25 | children, | 26 | children, |
26 | htmlFor, | 27 | htmlFor, |
28 | isRequired, | ||
27 | } = this.props; | 29 | } = this.props; |
28 | 30 | ||
31 | if (!showLabel) return children; | ||
32 | |||
29 | return ( | 33 | return ( |
30 | <label | 34 | <label |
31 | className={classnames({ | 35 | className={classnames({ |
@@ -34,7 +38,7 @@ class LabelComponent extends Component<ILabel> { | |||
34 | htmlFor={htmlFor} | 38 | htmlFor={htmlFor} |
35 | > | 39 | > |
36 | {showLabel && ( | 40 | {showLabel && ( |
37 | <span className={classes.label}>{title}</span> | 41 | <span className={classes.label}>{title}{isRequired && ' *'}</span> |
38 | )} | 42 | )} |
39 | <div className={classes.content}> | 43 | <div className={classes.content}> |
40 | {children} | 44 | {children} |