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

mega menu - fixing click area #481

Merged
merged 2 commits into from
Jun 14, 2024
Merged

Conversation

MauserBitfly
Copy link
Contributor

This PR:

  • fixes the clickable area for the mega menu buttons
  • improves performance (before the mega menu was reacreated on every latestState update): available currencies are now only updated if they really change

Copy link
Contributor

@thib-wien thib-wien left a comment

Choose a reason for hiding this comment

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

Gut :)

const available = computed<Currency[]>(() => {
const list: Currency[] = [networkInfo.value.elCurrency]
watch(latestState, () => {
let list: Currency[] = [networkInfo.value.elCurrency]
Copy link
Contributor

Choose a reason for hiding this comment

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

In the future, when the user switches between networks, the list of available currencies might stay outdated for a few seconds until the rates changes.
I am thinking about a switch between Gnosis (GNO + xDAI) and Ethereum (where these currencies might not be listed) for example.

A possible fix would be on line 31:

watch([latestState,networkInfo], () => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense - changed!

Copy link

cloudflare-workers-and-pages bot commented Jun 14, 2024

Deploying beaconchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 492b263
Status: ✅  Deploy successful!
Preview URL: https://5c41adfa.beaconchain.pages.dev
Branch Preview URL: https://bids-3136-megamenu-click-ere.beaconchain.pages.dev

View logs

@MauserBitfly MauserBitfly requested a review from thib-wien June 14, 2024 10:49
Copy link
Contributor

@thib-wien thib-wien left a comment

Choose a reason for hiding this comment

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

🚀

@MauserBitfly MauserBitfly merged commit ddf0753 into main Jun 14, 2024
2 checks passed
@MauserBitfly MauserBitfly deleted the BIDS-3136/megamenu-click-ereas branch June 14, 2024 11:07
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.

2 participants