Skip to content

Commit

Permalink
fix: move location reference to component scope
Browse files Browse the repository at this point in the history
  • Loading branch information
helciofranco committed Jan 7, 2025
1 parent 58eb515 commit 25bace8
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions packages/react/src/ui/Connect/components/Connector/Connecting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@ enum ConnectStep {
SIGN = 'sign',
}

const copy = {
[ConnectStep.CONNECT]: {
description: `Click on the button below to connect to ${location.origin}.`,
cta: 'Connect',
},
[ConnectStep.SIGN]: {
description:
'Sign this message to prove you own this wallet and proceed. Canceling will disconnect you.',
cta: 'Sign',
},
} as const;

export function Connecting({ className }: ConnectorProps) {
const { fuel } = useFuel();
const {
Expand All @@ -58,7 +46,18 @@ export function Connecting({ className }: ConnectorProps) {
);

const { description, cta } = useMemo(() => {
return copy[connectStep];
if (connectStep === ConnectStep.CONNECT) {
return {
description: `Click on the button below to connect to ${location.origin}.`,
cta: 'Connect',
};
}

return {
description:
'Sign this message to prove you own this wallet and proceed. Canceling will disconnect you.',
cta: 'Sign',
};
}, [connectStep]);

// Auto-close connecting
Expand Down

0 comments on commit 25bace8

Please sign in to comment.