Skip to content

Commit

Permalink
fix(ui): Move connection loading usage outside of the connection butt…
Browse files Browse the repository at this point in the history
…ons (#3725)

Co-authored-by: Joe Bell <[email protected]>
  • Loading branch information
alexcarpenter and joe-bell authored Jul 16, 2024
1 parent 3d3d5ae commit 6bdfb52
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .changeset/soft-radios-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
22 changes: 12 additions & 10 deletions packages/ui/src/common/connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ export function Connections(props: { disabled?: boolean }) {
const iconKey = connection?.icon;
const IconComponent = iconKey ? Icon[iconKey] : null;
return (
<Common.Connection
<Common.Loading
key={c.provider}
name={c.provider}
asChild
scope={`provider:${c.provider}`}
>
<Common.Loading scope={`provider:${c.provider}`}>
{isConnectionLoading => {
return (
{isConnectionLoading => {
return (
<Common.Connection
name={c.provider}
asChild
>
<Connection.Button
busy={isConnectionLoading}
disabled={props?.disabled || isConnectionLoading}
Expand All @@ -32,10 +34,10 @@ export function Connections(props: { disabled?: boolean }) {
>
{connection?.name || c.provider}
</Connection.Button>
);
}}
</Common.Loading>
</Common.Connection>
</Common.Connection>
);
}}
</Common.Loading>
);
})}
</Connection.Root>
Expand Down

0 comments on commit 6bdfb52

Please sign in to comment.