Skip to content

Commit 1903b12

Browse files
houhoucoopderekbit
authored andcommitted
feat: hide inputs if there is no data
Signed-off-by: Yi-Ya Chen <[email protected]>
1 parent fa93062 commit 1903b12

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/routes/backingImage/RestoreBackupBackingImageModal.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,16 @@ const modal = ({
5151
<FormItem label="Backup" {...formItemLayout}>
5252
{getFieldDecorator('backup', { initialValue: item.name || '' })(<Input disabled={!!item.name} />)}
5353
</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} />)}
59-
</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)