Skip to content

Commit

Permalink
fix: expand click area for add new connection (#7395)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsweet authored Apr 28, 2024
1 parent 6ab1d29 commit f51e718
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const AddConnectionDialog = ({ disabled = [], onCancel, onSubmit }: Props

const options = useMemo(
() =>
[{}].concat(
[{ value: '' }].concat(
connections
.filter((cs) => (disabled.length ? !disabled.includes(cs.unique) : true))
.map((cs) => ({
Expand Down Expand Up @@ -110,7 +110,7 @@ export const AddConnectionDialog = ({ disabled = [], onCancel, onSubmit }: Props
optionRender={(option, { index }) => {
if (index === 0) {
return (
<Button size="small" type="link" icon={<PlusOutlined />} onClick={() => navigate('/connections')}>
<Button size="small" type="link" icon={<PlusOutlined />}>
Add New Connection
</Button>
);
Expand All @@ -121,7 +121,12 @@ export const AddConnectionDialog = ({ disabled = [], onCancel, onSubmit }: Props
</Option>
);
}}
onChange={(value) => setSelectedValue(value)}
onChange={(value) => {
if (!value) {
navigate('/connections');
}
setSelectedValue(value);
}}
/>
</Block>
<Space style={{ display: 'flex', justifyContent: 'flex-end' }}>
Expand Down

0 comments on commit f51e718

Please sign in to comment.