Skip to content

Commit d4e657a

Browse files
committed
Hide checkbox when only one file is in preview
1 parent 008af04 commit d4e657a

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

‎packages/ui/src/components/editor/panel/ResponsePreview/ResponsePreview.tsx‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,18 @@ export const ResponsePreview: FC<Props> = (props) => {
156156
}`}
157157
>
158158
<div className={styles['list__file__left']}>
159-
<Checkbox
160-
checked={file.is_checked}
161-
disabled={files_in_preview.length == 1}
162-
on_change={(checked) => {
163-
props.on_toggle_file({
164-
file_path: file.file_path,
165-
workspace_name: file.workspace_name,
166-
is_checked: checked
167-
})
168-
}}
169-
/>
159+
{files_in_preview.length > 1 && (
160+
<Checkbox
161+
checked={file.is_checked}
162+
on_change={(checked) => {
163+
props.on_toggle_file({
164+
file_path: file.file_path,
165+
workspace_name: file.workspace_name,
166+
is_checked: checked
167+
})
168+
}}
169+
/>
170+
)}
170171
<div
171172
className={cn(styles['list__file__left__label'], {
172173
[styles['list__file__left__label--new']]:

0 commit comments

Comments
 (0)