-
Notifications
You must be signed in to change notification settings - Fork 14
feat: advertise supported networks, tokens and bank rails in landing FAQ #2338
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
Merged
+144
−3
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
df27ff3
feat: advertise supported networks, tokens and bank rails in landing FAQ
Hugo0 02da547
refactor: single-source the FAQ rail facts per code review
Hugo0 fb1ac5d
feat: position supported-rails FAQ right after 'What is Peanut?' (Hug…
Hugo0 8d4d799
fix: derive non-EVM chain names in FAQ copy from OTHER_SUPPORTED_CHAI…
Hugo0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| 'use client' | ||
|
|
||
| import ChainChip from '@/components/AddMoney/components/ChainChip' | ||
| import { CHAIN_LOGOS, OTHER_SUPPORTED_CHAINS, SUPPORTED_EVM_CHAINS, getSupportedTokens } from '@/constants/rhino.consts' | ||
| import { FIAT_RAILS } from '@/constants/faq.consts' | ||
| import { chainDisplayName } from '@/utils/chain-display.utils' | ||
|
|
||
| /** | ||
| * Rich answer body for the "which networks, tokens and banks?" landing FAQ item. | ||
| * Renders from the same rhino.consts constants as the add-money Choose Network | ||
| * drawer (and FIAT_RAILS shared with the plain-text SEO answer), so the FAQ | ||
| * always advertises exactly what the app supports. | ||
| */ | ||
| export function SupportedRailsFaqAnswer() { | ||
| return ( | ||
| <div className="flex flex-col gap-5"> | ||
| <div> | ||
| <p className="mb-2"> | ||
| Crypto — one deposit address for all {SUPPORTED_EVM_CHAINS.length} EVM networks, plus{' '} | ||
| {OTHER_SUPPORTED_CHAINS.map(chainDisplayName).join(' and ')}: | ||
| </p> | ||
| <div className="flex flex-wrap gap-1 rounded-sm border border-n-1 bg-white p-2"> | ||
| {[...SUPPORTED_EVM_CHAINS, ...OTHER_SUPPORTED_CHAINS].map((chain) => ( | ||
| <ChainChip key={chain} chainName={chainDisplayName(chain)} chainSymbol={CHAIN_LOGOS[chain]} /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| <div> | ||
| <p className="mb-2">Tokens:</p> | ||
| <div className="flex flex-wrap gap-1 rounded-sm border border-n-1 bg-white p-2"> | ||
| {getSupportedTokens('EVM').map((token) => ( | ||
| <ChainChip key={token.name} chainName={token.name} chainSymbol={token.logoUrl} /> | ||
| ))} | ||
| </div> | ||
| <p className="mt-2 text-base text-grey-1"> | ||
| USDC & USDT on every network · ETH on EVM networks · Tron is USDT-only | ||
| </p> | ||
| </div> | ||
| <div> | ||
| <p className="mb-2">Banks & local payment apps:</p> | ||
| <ul className="flex flex-col gap-1.5"> | ||
| {FIAT_RAILS.map((rail) => ( | ||
| <li key={rail.name} className="flex items-baseline gap-2"> | ||
| <span>{rail.flag}</span> | ||
| <span>{rail.name}</span> | ||
| <span className="text-base text-grey-1"> | ||
| {rail.currency} · {rail.region} | ||
| </span> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| </div> | ||
| <p className="text-base text-grey-1">Deposits are free — Peanut covers the gas.</p> | ||
| </div> | ||
| ) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { OTHER_SUPPORTED_CHAINS, SUPPORTED_EVM_CHAINS } from '@/constants/rhino.consts' | ||
| import { chainDisplayName } from '@/utils/chain-display.utils' | ||
|
|
||
| /** | ||
| * The "which networks, tokens and banks?" landing FAQ item. Question, fiat-rail | ||
| * facts and plain-text answer live here (server-safe, feeds the FAQPage JSON-LD | ||
| * via getLandingContent); the rich chip UI is rendered client-side by | ||
| * SupportedRailsFaqAnswer, matched by id. Chain names derive from rhino.consts | ||
| * and the visible rails render from FIAT_RAILS, so the public answer and the | ||
| * on-page UI share one source and can't drift from what the app supports. | ||
| */ | ||
| export const SUPPORTED_RAILS_FAQ_ID = 'supported-rails' | ||
|
|
||
| export const FIAT_RAILS = [ | ||
| { flag: '🇺🇸', name: 'ACH & Wire', currency: 'USD', region: 'United States' }, | ||
| { flag: '🇪🇺', name: 'SEPA', currency: 'EUR', region: '36 countries' }, | ||
| { flag: '🇬🇧', name: 'Faster Payments', currency: 'GBP', region: 'United Kingdom' }, | ||
| { flag: '🇲🇽', name: 'SPEI', currency: 'MXN', region: 'Mexico' }, | ||
| { flag: '🇦🇷', name: 'Mercado Pago', currency: 'ARS', region: 'Argentina' }, | ||
| { flag: '🇧🇷', name: 'Pix', currency: 'BRL', region: 'Brazil' }, | ||
| ] as const | ||
|
|
||
| const EVM_CHAIN_LIST = SUPPORTED_EVM_CHAINS.map(chainDisplayName).join(', ') | ||
| const OTHER_CHAIN_LIST = OTHER_SUPPORTED_CHAINS.map(chainDisplayName).join(' and ') | ||
| const FIAT_RAIL_LIST = FIAT_RAILS.map((rail) => `${rail.name} (${rail.currency}, ${rail.region})`).join(', ') | ||
|
|
||
| export const SUPPORTED_RAILS_FAQ_QUESTION = 'Which networks, tokens and banks does Peanut support?' | ||
|
|
||
| export const SUPPORTED_RAILS_FAQ_ANSWER = | ||
| `Crypto: deposit and withdraw USDC and USDT on ${SUPPORTED_EVM_CHAINS.length} EVM networks with a single address (${EVM_CHAIN_LIST}), plus ${OTHER_CHAIN_LIST}. ETH is also supported on EVM networks; Tron is USDT-only. ` + | ||
| `Banks & local payment apps: ${FIAT_RAIL_LIST}. ` + | ||
| 'Deposits are free — Peanut covers the gas.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // Display labels where plain title-case reads wrong. | ||
| const CHAIN_DISPLAY_OVERRIDES: Record<string, string> = { | ||
| BNB: 'BNB Chain', | ||
| } | ||
|
|
||
| /** rhino.consts chain key (e.g. 'ARBITRUM', 'BNB') → human display name */ | ||
| export const chainDisplayName = (chain: string): string => | ||
| CHAIN_DISPLAY_OVERRIDES[chain] ?? chain.charAt(0) + chain.slice(1).toLowerCase() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.