Skip to content

Commit 3294266

Browse files
committed
feat: hide inputs if there is no data
Signed-off-by: Yi-Ya Chen <[email protected]>
1 parent 2fcb5e9 commit 3294266

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/routes/backingImage/RestoreBackupBackingImageModal.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,18 @@ const modal = ({
4949
<ModalBlur {...modalOpts}>
5050
<Form layout="horizontal">
5151
<FormItem label="Backup" {...formItemLayout}>
52-
{getFieldDecorator('backup', { initialValue: item.name || '' })(<Input disabled={!!item.name} />)}
53-
</FormItem>
54-
<FormItem label="Secret" hasFeedback {...formItemLayout}>
55-
{getFieldDecorator('secret', { initialValue: item.secret || '' })(<Input disabled={!!item.secret} />)}
56-
</FormItem>
57-
<FormItem label="Secret Namespace" hasFeedback {...formItemLayout}>
58-
{getFieldDecorator('secretNamespace', { initialValue: item.secretNamespace || '' })(<Input disabled={!!item.secretNamespace} />)}
52+
{getFieldDecorator('backup', { initialValue: item.name || '' })(<Input disabled />)}
5953
</FormItem>
54+
{item.secret && (
55+
<FormItem label="Secret" hasFeedback {...formItemLayout}>
56+
{getFieldDecorator('secret', { initialValue: item.secret })(<Input disabled />)}
57+
</FormItem>
58+
)}
59+
{item.secretNamespace && (
60+
<FormItem label="Secret Namespace" hasFeedback {...formItemLayout}>
61+
{getFieldDecorator('secretNamespace', { initialValue: item.secretNamespace })(<Input disabled />)}
62+
</FormItem>
63+
)}
6064
</Form>
6165
</ModalBlur>
6266
)

0 commit comments

Comments
 (0)