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
Update Swap ETH for USDC/DAI link on stablecoin page [FIXES #12873] #12874
Conversation
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
src/pages/stablecoins.tsx
Outdated
@@ -526,7 +526,7 @@ const StablecoinsPage = ({ markets, marketsHasError }) => { | |||
</Text> | |||
<Flex direction="column"> | |||
<Box> | |||
<ButtonLink mb={4} me={4} to="https://1inch.exchange"> | |||
<ButtonLink mb={4} me={4} target="_blank" href="https://matcha.xyz/tokens/ethereum/0x6b175474e89094c44da98b954eedeac495271d0f?sellChain=1&sellAddress=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to
was giving a "deprecated" warning so I updated the usage to href
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pettinarip do you remember what the nuance here was? i see our Link
component accepts both
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@minimalsm Would you prefer I revert back to the original usage?
src/pages/stablecoins.tsx
Outdated
@@ -526,7 +526,7 @@ const StablecoinsPage = ({ markets, marketsHasError }) => { | |||
</Text> | |||
<Flex direction="column"> | |||
<Box> | |||
<ButtonLink mb={4} me={4} to="https://1inch.exchange"> | |||
<ButtonLink mb={4} me={4} target="_blank" href="https://matcha.xyz/tokens/ethereum/0x6b175474e89094c44da98b954eedeac495271d0f?sellChain=1&sellAddress=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this, our link component automatically adds target="_blank"
to external links :)
<ButtonLink mb={4} me={4} target="_blank" href="https://matcha.xyz/tokens/ethereum/0x6b175474e89094c44da98b954eedeac495271d0f?sellChain=1&sellAddress=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"> | |
<ButtonLink mb={4} me={4} href="https://matcha.xyz/tokens/ethereum/0x6b175474e89094c44da98b954eedeac495271d0f?sellChain=1&sellAddress=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes! My apologies, removed both in the latest commit. @minimalsm
src/pages/stablecoins.tsx
Outdated
@@ -576,7 +576,8 @@ const StablecoinsPage = ({ markets, marketsHasError }) => { | |||
<ButtonLink | |||
mb={4} | |||
me={4} | |||
to="https://matcha.xyz/tokens/ethereum/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" | |||
target="_blank" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target="_blank" |
f277b45
to
0944e9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks @barskhianfannie! Loved the YouTube explainer of the issue too, haven't come across that before =)
And yeah, any to
was deprecated (still works, but phasing out in preference of href
) and href that begins with http
will be parsed as an external link and handled accordingly (open in new tab, etc)... This can be forced manually by adding the isExternal
prop, but this is rarely needed.
Congrats, your important contribution to this open-source project has earned you a GitPOAP! Be sure to join the Ethereum.org discord if you are interested in contributing further to the project or have any questions for the team. GitPOAP: 2024 Ethereum.org Contributor: Head to gitpoap.io & connect your GitHub account to mint! Learn more about GitPOAPs here. |
@all-contributors please add @barskhianfannie for maintenance |
I've put up a pull request to add @barskhianfannie! 🎉 |
This changeset updates the
Swap ETH for Dai
andSwap ETH for USDC
button destination URLS on the stablecoin page to a valid token page where ETH is set as the sell token, and either DAI or USDC as the buy token as the button text suggests.PR Walkthrough of changes and issues seen in production
Description
Update the links used on this page to lead to a valid token page which has Ethereum as the sell token and
USDC
orDAI
as the buy token.Add
target="_blank"
to ensure these pages open in a separate tab allowing users to explore the external content without losing their place on the Stablecoin page..Related Issue
FIXES #12873