Skip to content

Conversation

fionnachan
Copy link
Member

@fionnachan fionnachan commented Oct 2, 2025

Summary

Steps to test

Copy link

vercel bot commented Oct 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
arbitrum-portal Ready Ready Preview Oct 17, 2025 3:44pm

@fionnachan fionnachan changed the title move moonpay into its own file feat: add more onramp services Oct 2, 2025
Base automatically changed from buy-route to master October 6, 2025 09:54
@fionnachan fionnachan marked this pull request as draft October 6, 2025 10:28
@fionnachan fionnachan marked this pull request as ready for review October 7, 2025 08:45
import EmbedPageWrapper from '../../EmbedPageWrapper';

type Props = {
searchParams: { [key: string]: string | string[] | undefined };
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: once we migrate to turbopack, this can reimport SearchParamsProps type (it need to be awaited)

Comment on lines 22 to 34
/**
* This code is run on every query param change,
* we don't want to sanitize every query param change.
* It should only be executed once per user per session.
*/
if (searchParams.sanitized !== 'true') {
addOrbitChainsToArbitrumSDK();
await sanitizeAndRedirect(searchParams, `${PathnameEnum.BUY}/${params.slug}`);
}

return (
<BridgePageWrapper searchParams={searchParams} redirectPath={`/bridge/buy/${params.slug}`} />
);
Copy link
Contributor

Choose a reason for hiding this comment

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

We can reuse bridgePageUtils no?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not needed for now because parent are already using use client, but I would explicitely say that it requires it here

}
return formatUSD(ethToUSD(Number(utils.formatEther(BigNumber.from(balanceState.value)))));
}, [balanceState, ethToUSD, showPriceInUsd]);
const isBalanceLessThan15Usd = Number(balanceInUsd?.replaceAll(/[$<]/g, '')) < 15;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we compare against balanceState instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

We want to do <15 USD so it has to be the value in USD, rather than ETH balance value

Copy link
Contributor

Choose a reason for hiding this comment

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

We can compare to ethToUSD(...), we would be able to compare without replacing anything

Copy link
Member Author

Choose a reason for hiding this comment

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

oh perfect thanks


if (embedMode) {
if (pathname === PathnameEnum.EMBED_BUY && showBuyPanel) {
if (pathname.startsWith(PathnameEnum.EMBED_BUY) && showBuyPanel) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We have this condition in few places, maybe we can abstract that away? (only the first part)


export function LinkoutOnrampPanel({ serviceSlug }: { serviceSlug: string }) {
const { embedMode } = useMode();
const service = onrampServices.find((s) => s.slug === serviceSlug);
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT/FYI: When we have array of something we want to map and at the same time access. It's usually easier to have 2 objects:

  • One Map<id, services>
  • One array of only ids

className={twMerge(
'relative flex w-full flex-col items-center justify-center rounded-md bg-gray-9 p-4 overflow-hidden',
)}
onClick={() => {}}
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we have an empty onClick?

Copy link
Member Author

Choose a reason for hiding this comment

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

we use the Link anchor to navigate, but it is a button

Copy link
Contributor

Choose a reason for hiding this comment

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

Then we can remove the onClick here


const allOnrampOnClick = useCallback(() => {
router.push(
'/projects?chains=arbitrum-one_arbitrum-nova_apechain_cheese_degen_ebi-xyz_pop-apex_reya_sanko_xai_xchain&subcategories=fiat-on-ramp',
Copy link
Contributor

Choose a reason for hiding this comment

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

Chains should not be hardcoded here. Let's simply redirect to the correct subcategory - https://portal.arbitrum.io/projects?subcategories=fiat-on-ramp

Copy link
Member Author

Choose a reason for hiding this comment

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

I was given this link by product, let me check with them if they are ok with all chains

<div
className={twMerge(
'w-full overflow-hidden rounded-lg pb-8 text-white sm:max-w-[600px]',
'bg-gray-1 rounded-md border border-white/30 px-6 py-7 pb-8 text-white w-full sm:max-w-[600px] min-h-[600px] flex flex-col',
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't hardcode the bg-color here especially in embed mode. It must take on the color (or it's variant) passed on by the theme.

Image

Copy link
Contributor

Choose a reason for hiding this comment

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

And I think same with the tile background colors. I feel they should be translucent so that they derive their colors from background's theme.

Else we have a primary button theme as well but I dont think that should be used here since it would conflict with the icons' themes.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks for flagging, this wasn't considered in the design at all, so i'll relay that to design team and let them figure it out and apply the changes when they provide them

className={twMerge(
'relative flex w-full flex-col items-center justify-center rounded-md bg-gray-9 p-4 overflow-hidden',
)}
onClick={() => {}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's track all the onramp clicks in posthog.

return (
<div
className={twMerge(
'relative bg-gray-1 rounded-md border border-gray-8 px-5 pt-14 pb-6 text-white -mx-4 md:mx-0 w-[calc(100%_+_40px)] md:w-full',
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here - the color should not be hardcoded, atleast in embed mode - but it should be translucent so that it derives from the widget-bg-color, or should be a variant of widget-bg-color if we want it to be opaque.

Image

Copy link
Member Author

Choose a reason for hiding this comment

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

flagged to design

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