Skip to content

Commit 37110e1

Browse files
committed
feat(image): when resourceImage != both, hide Tabslist to cleanup UI
1 parent 2000ce0 commit 37110e1

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

src/extensions/Image/components/ActionImageButton.tsx

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -161,23 +161,17 @@ function ActionImageButton(props: any) {
161161
: 'link'
162162
}
163163
>
164-
<TabsList className="richtext-grid richtext-w-full richtext-grid-cols-2">
165-
{uploadOptions.resourceImage === 'both' || uploadOptions.resourceImage === 'upload'
166-
? (
167-
<TabsTrigger value="upload">
168-
{t('editor.image.dialog.tab.upload')}
169-
</TabsTrigger>
170-
)
171-
: <></>}
172-
173-
{uploadOptions.resourceImage === 'both' || uploadOptions.resourceImage === 'link'
174-
? (
175-
<TabsTrigger value="link">
176-
{t('editor.image.dialog.tab.url')}
177-
</TabsTrigger>
178-
)
179-
: <></>}
180-
</TabsList>
164+
165+
{(uploadOptions.resourceImage === 'both') && (
166+
<TabsList className="richtext-grid richtext-w-full richtext-grid-cols-2">
167+
<TabsTrigger value="upload">
168+
{t('editor.image.dialog.tab.upload')}
169+
</TabsTrigger>
170+
<TabsTrigger value="link">
171+
{t('editor.image.dialog.tab.url')}
172+
</TabsTrigger>
173+
</TabsList>
174+
)}
181175

182176
<div className="richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]">
183177
<Checkbox

0 commit comments

Comments
 (0)