Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend): move wallet connect btn out of menu into header #3103

Merged
merged 24 commits into from
Oct 29, 2024

Conversation

loki344
Copy link
Collaborator

@loki344 loki344 commented Oct 24, 2024

Motivation

Instead of displaying the wallet connect button as a menu item in the popover, we want to display it in the header at any time.

Changes

  • remove MenuItem for WalletConnect out of dropdown to the header
  • extend WalletConnectButton to show connected and disconnected state.
  • rename existing MenuWallet into MenuAdresses because that's the only content now

Tests

before:
image

after:
image

image

@loki344 loki344 marked this pull request as ready for review October 24, 2024 12:56
@loki344 loki344 requested a review from a team as a code owner October 24, 2024 12:56
{#if walletOptions}
<MenuWallet on:icMenuClick={hidePopover} />
{#if yourAddressesOption}
<MenuYourAddresses on:icMenuClick={hidePopover} />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, is there a good reason to not show this option when a user is in the settings route?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is a good question... I remember there was some talk about this at some point, but the PR is #1900

Maybe worth asking design team?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thank you for linking this issue - It seems as the YourAdresses functionality also does not work on the /explore route, so I have to exclude it there as well.

{#if walletOptions}
<MenuWallet on:icMenuClick={hidePopover} />
{#if yourAddressesOption}
<MenuYourAddresses on:icMenuClick={hidePopover} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is a good question... I remember there was some talk about this at some point, but the PR is #1900

Maybe worth asking design team?

src/frontend/src/lib/components/hero/Header.svelte Outdated Show resolved Hide resolved
disabled={$walletConnectPaired}
>
<IconWalletConnect size="22" slot="icon" />
<svelte:fragment>{$i18n.wallet_connect.text.name}</svelte:fragment>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for svelte:fragment here

</script>

{#if nonNullish(listener)}
<WalletConnectButton on:click={disconnect}
>{$i18n.wallet_connect.text.disconnect}</WalletConnectButton
>
{:else}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AntonioVentilii-DFINITY How do you test the wallet connect functionality locally?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally connect with https://app.uniswap.org/

</script>

{#if nonNullish(listener)}
<WalletConnectButton on:click={disconnect}
>{$i18n.wallet_connect.text.disconnect}</WalletConnectButton
>
{:else}
<WalletConnectButton ariaLabel={$i18n.wallet_connect.text.name} on:click={openWalletConnectAuth}
></WalletConnectButton>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/> instead of ></WalletConnectButton> ?

@loki344 loki344 enabled auto-merge (squash) October 29, 2024 15:10
@loki344 loki344 merged commit cc02616 into main Oct 29, 2024
10 checks passed
@loki344 loki344 deleted the feat(frontend)/move-wallet-connect-btn branch October 29, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants