Skip to content

Commit 2b31fb6

Browse files
author
Roman Snapko
committed
Conditionally render "Edit" button based on selectConnectionOpen.
1 parent f966e16 commit 2b31fb6

1 file changed

Lines changed: 19 additions & 17 deletions

File tree

packages/react-ui/src/app/features/builder/step-settings/block-settings/connection-select.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -181,23 +181,25 @@ const ConnectionSelect = memo((params: ConnectionSelectProps) => {
181181

182182
{field.value && !field.disabled && !params.disabled && (
183183
<div className="shrink-0 flex items-center gap-1">
184-
<Button
185-
type="button"
186-
variant="ghost"
187-
size="xs"
188-
className="text-primary-700 text-base font-medium"
189-
onPointerDown={suppressPointerOrMouseDown}
190-
onMouseDown={suppressPointerOrMouseDown}
191-
onKeyDown={makeActivationKeysHandler((e) =>
192-
handleReconnectClick(e),
193-
)}
194-
onClick={(e) => {
195-
handleReconnectClick(e);
196-
}}
197-
>
198-
<PencilLine size={16} />
199-
{t('Edit')}
200-
</Button>
184+
{selectConnectionOpen && (
185+
<Button
186+
type="button"
187+
variant="ghost"
188+
size="xs"
189+
className="text-primary-700 text-base font-medium"
190+
onPointerDown={suppressPointerOrMouseDown}
191+
onMouseDown={suppressPointerOrMouseDown}
192+
onKeyDown={makeActivationKeysHandler((e) =>
193+
handleReconnectClick(e),
194+
)}
195+
onClick={(e) => {
196+
handleReconnectClick(e);
197+
}}
198+
>
199+
<PencilLine size={16} />
200+
{t('Edit')}
201+
</Button>
202+
)}
201203

202204
<Button
203205
type="button"

0 commit comments

Comments
 (0)