Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
ea4564c
minor fixes
Hugo0 Mar 10, 2025
3b3b8fd
feat: PoC for multi-chain support for peanut wallets with Polygon int…
jjramirezn Mar 5, 2025
b58f662
fix: isWalletConnected typing
jjramirezn Mar 5, 2025
6bfe83d
fix: correctly set selected wallet id
jjramirezn Mar 6, 2025
4041fe5
docs: remove non useful comment
jjramirezn Mar 6, 2025
105f511
refactor: centralize and comment kernel constant
jjramirezn Mar 6, 2025
e8023ed
refactor: use type status from wallet hook
jjramirezn Mar 6, 2025
28dbc17
fix: double import
jjramirezn Mar 10, 2025
9cfaafe
Merge pull request #721 from peanutprotocol/feat/multiclient-pw
jjramirezn Mar 10, 2025
ce59e69
Revert "fix: add reference to request"
jjramirezn Mar 10, 2025
766eb5d
fix: add error handling to history page
jjramirezn Mar 11, 2025
7777bce
fix: dont show dollar sign for tokens
jjramirezn Mar 11, 2025
5d26265
fix: req preview receipient
kushagrasarathe Mar 11, 2025
b7750e4
fix: wallet header confirm modal condition + ui
kushagrasarathe Mar 11, 2025
f9fce96
Merge pull request #730 from peanutprotocol/fix/wh-ui
kushagrasarathe Mar 11, 2025
dc722ab
fix: add bsc/binance chain logo
jjramirezn Mar 11, 2025
f81e460
fix: actually use the correct chain logo
jjramirezn Mar 11, 2025
1059852
fix: add bnb chain logo
jjramirezn Mar 11, 2025
266a125
feat: claim rewards modal ui
kushagrasarathe Mar 11, 2025
2c0621e
feat: find rewards for user
jjramirezn Mar 11, 2025
3f78708
feat: update wallet card & wallet header for rewards + base wallet se…
kushagrasarathe Mar 11, 2025
d9dffac
feat: pinta account page ui
kushagrasarathe Mar 12, 2025
b65c462
Merge pull request #732 from peanutprotocol/feat/pinta-claim-modal
jjramirezn Mar 12, 2025
eb6d9c7
Merge pull request #733 from peanutprotocol/feat/pinta-account-page
jjramirezn Mar 12, 2025
37561c7
fix: chat with support
Hugo0 Mar 12, 2025
0ebf371
Merge branch 'peanut-wallet-dev' into fix/copy-issues-mar-10
Hugo0 Mar 12, 2025
705d105
Merge pull request #726 from peanutprotocol/fix/copy-issues-mar-10
Hugo0 Mar 12, 2025
5b3decb
fix: cashout link
Hugo0 Mar 12, 2025
8406759
Merge pull request #734 from peanutprotocol/fix/copy-issues-mar-10
Hugo0 Mar 12, 2025
3960b7d
fix(request): fix amount calculation for specific token requests
jjramirezn Mar 12, 2025
b06628f
chore: hide reference/attachment fields in payment form
jjramirezn Mar 12, 2025
1002142
feat: disable rewards wallet on non-pinta flow
kushagrasarathe Mar 12, 2025
c2e4f00
Merge branch 'peanut-wallet-dev' into feat/rewards-wallet
kushagrasarathe Mar 12, 2025
721a451
style: Apply prettier formatting
kushagrasarathe Mar 12, 2025
c03c162
Merge pull request #731 from peanutprotocol/feat/find-rewards
jjramirezn Mar 12, 2025
a8d9ecc
fix: wallet header conifrmation modal condition
kushagrasarathe Mar 12, 2025
26b0081
Merge branch 'feat/rewards-wallet' of https://github.com/peanutprotoc…
kushagrasarathe Mar 12, 2025
9fcdb6c
feat: update partner bar location
kushagrasarathe Mar 12, 2025
5e38d9b
Merge pull request #735 from peanutprotocol/feat/rewards-wallet
jjramirezn Mar 12, 2025
2916131
build: bump peanut-sdk version to 0.6.0
jjramirezn Mar 12, 2025
ba25a70
feat: ios deeplink test
jjramirezn Mar 13, 2025
7e88da9
feat: update success view ui to match .to env
kushagrasarathe Mar 13, 2025
74ffbdb
Merge branch 'peanut-wallet-dev' into fix/success-view-ui
kushagrasarathe Mar 13, 2025
41f710c
fix: consistently order accounts
jjramirezn Mar 13, 2025
7d04475
feat: integrate claim modal with rewards api
kushagrasarathe Mar 13, 2025
98b0e31
Merge pull request #738 from peanutprotocol/fix/order-accounts
kushagrasarathe Mar 13, 2025
45d2bb7
feat: mock layout ui for pinta req pay flow
kushagrasarathe Mar 14, 2025
f10c56c
feat: pinta pay success view
kushagrasarathe Mar 14, 2025
41b4cd2
fix: reward link href
kushagrasarathe Mar 14, 2025
5780c22
Merge pull request #739 from peanutprotocol/feat/integrate-rewards
kushagrasarathe Mar 14, 2025
b76033a
Merge branch 'peanut-wallet-dev' into feat/pinta-req-pay
kushagrasarathe Mar 14, 2025
969c8d5
feat: add link to learn how to receive money through peanut
jjramirezn Mar 14, 2025
48fb5d2
feat: qr scanner for pinta wallet
jjramirezn Mar 12, 2025
213f8b9
feat: recognize ens in qr scanner
jjramirezn Mar 14, 2025
0f7c1e2
Merge pull request #736 from peanutprotocol/feat/add-qr-scanner
jjramirezn Mar 14, 2025
7fa8a5a
feat: pay pinta req integration
kushagrasarathe Mar 14, 2025
198ecd7
Merge branch 'peanut-wallet-dev' into feat/pinta-req-pay
kushagrasarathe Mar 14, 2025
5e0d952
feat: add claim link creation logging
jjramirezn Mar 14, 2025
d65b583
fix: show correct source txhash
jjramirezn Mar 14, 2025
f5ce3f6
fix: add nav header in mobile view + minor ui fixes
kushagrasarathe Mar 15, 2025
9e1a05b
fix: attachment url rendering
kushagrasarathe Mar 15, 2025
29a24cb
Merge pull request #741 from peanutprotocol/fix/ui-issues
kushagrasarathe Mar 15, 2025
43cb649
update: pwa icon
kushagrasarathe Mar 15, 2025
36fac8f
fix: history ui bugs
kushagrasarathe Mar 16, 2025
88f0069
Merge pull request #742 from peanutprotocol/fix/history-ui
kushagrasarathe Mar 16, 2025
48f392e
Merge pull request #737 from peanutprotocol/fix/success-view-ui
Hugo0 Mar 17, 2025
eae1db8
fix: payment component borders
kushagrasarathe Mar 17, 2025
21def37
Merge branch 'peanut-wallet-dev' of https://github.com/peanutprotocol…
kushagrasarathe Mar 17, 2025
a039118
Merge branch 'peanut-wallet-dev' into feat/pinta-req-pay
kushagrasarathe Mar 17, 2025
644aa67
fix: use existing payment flows for pinta req with updated ui
kushagrasarathe Mar 17, 2025
324104b
fix: update pinta req consts
kushagrasarathe Mar 17, 2025
2acd577
fix: payment form conditional rendering
kushagrasarathe Mar 17, 2025
86f9d00
Merge pull request #740 from peanutprotocol/feat/pinta-req-pay
jjramirezn Mar 17, 2025
1079989
feat: support amount param in pnt req url
jjramirezn Mar 17, 2025
e5b3054
fix: partial mock utils on tests
jjramirezn Mar 17, 2025
db14db3
feat: fetch and render rewards wallet balance
kushagrasarathe Mar 17, 2025
6ea62b2
feat: update usdc reward claim modal ux copy
kushagrasarathe Mar 17, 2025
da05da8
Merge pull request #743 from peanutprotocol/feat/rewards-wallet-balance
jjramirezn Mar 17, 2025
083cc5a
feat: show beers in integer amounts
jjramirezn Mar 17, 2025
d977b2a
feat: update reward and logo images
kushagrasarathe Mar 17, 2025
f6060f2
feat: fix beer balance formatting
jjramirezn Mar 17, 2025
169a1cf
fix: pinta wallet behaviour in claim
jjramirezn Mar 17, 2025
a186437
fix: correct number of beers
jjramirezn Mar 18, 2025
4ba2d78
fix: runtime error in inputs when translating the app
kushagrasarathe Mar 18, 2025
e59bb57
Merge branch 'peanut-wallet-dev' into fix/translation-error
kushagrasarathe Mar 18, 2025
157183f
fix: show pnt logo on history
jjramirezn Mar 18, 2025
de4d1bb
feat: add translation mutation handler and wrapper
kushagrasarathe Mar 18, 2025
44d5f81
feat: allow users to go to claim and request receipts from history
jjramirezn Mar 18, 2025
ac4b9f6
Merge pull request #744 from peanutprotocol/fix/translation-error
jjramirezn Mar 18, 2025
3bf0811
feat: add payer information to request receipt
jjramirezn Mar 18, 2025
7c06c43
fix: attachment on claim links
jjramirezn Mar 18, 2025
c40d9d9
refactor: clean useClaimLink
jjramirezn Mar 18, 2025
eff369e
feat: user internal apis instead of justaname to resolve recipient
jjramirezn Mar 18, 2025
da58036
fix: update peanut pfp
kushagrasarathe Mar 18, 2025
a964f2f
feat: show primary-name in wallet header instead of connector name
kushagrasarathe Mar 18, 2025
a2b8887
fix: pwa icons for ios
kushagrasarathe Mar 18, 2025
c4494fc
Merge branch 'peanut-wallet-dev' of https://github.com/peanutprotocol…
kushagrasarathe Mar 18, 2025
968ef8b
feat: use scan qr button from the home for reward wallet
jjramirezn Mar 18, 2025
2c1eeca
fix: rerender
jjramirezn Mar 18, 2025
793aa27
fix: history page loading state
kushagrasarathe Mar 18, 2025
d046ed0
fix: correct selected wallet handling
jjramirezn Mar 18, 2025
80088a5
fix: simplify send and receive buttons
jjramirezn Mar 18, 2025
01fbcf5
fix: use viem parseUnits to avoid scientific notation
jjramirezn Mar 18, 2025
3384cef
feat: redirect after succes
jjramirezn Mar 19, 2025
bd29b64
fix: fix redirect url
jjramirezn Mar 19, 2025
92ae092
fix: close modal on click
jjramirezn Mar 19, 2025
d44087e
fix: dont show duplicate wallet toast
jjramirezn Mar 19, 2025
de1b195
fix: nav header and pre-alpha banner
kushagrasarathe Mar 19, 2025
5a44e4d
feat: show peanut sponsored tx msg on views
kushagrasarathe Mar 19, 2025
6e51b3a
Merge branch 'peanut-wallet-dev' of https://github.com/peanutprotocol…
kushagrasarathe Mar 19, 2025
31f63d2
fix: setup copy changes
Hugo0 Mar 18, 2025
92894ac
temp
Hugo0 Mar 18, 2025
f60fc92
fix: setup instructions
Hugo0 Mar 19, 2025
a7ee666
minor fixes
Hugo0 Mar 19, 2025
6f2ece3
old direct send screen
Hugo0 Mar 19, 2025
d2b2aec
fixes: post-jota pr reviews
Hugo0 Mar 19, 2025
1bda28f
feat: update claim guest flow ui cta's
kushagrasarathe Mar 19, 2025
7ac62bb
fix: post signup redirect on claim page
kushagrasarathe Mar 19, 2025
cddb902
Merge pull request #749 from peanutprotocol/fix/claim-guest-ui
kushagrasarathe Mar 19, 2025
5c54560
fix: prevent peanut word translation
kushagrasarathe Mar 19, 2025
7c38ae1
kushagra fixes
Hugo0 Mar 19, 2025
01de490
Merge branch 'peanut-wallet-dev' into fix/copy-issues-mar-10
Hugo0 Mar 19, 2025
9f63ab9
Merge pull request #745 from peanutprotocol/fix/copy-issues-mar-10
Hugo0 Mar 19, 2025
38c50ac
fix: AddressLink hotfix
Hugo0 Mar 19, 2025
199806d
dot hotfix
Hugo0 Mar 19, 2025
cedce65
hotfix 3: AddressLink
Hugo0 Mar 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/app/(mobile-ui)/history/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ const HistoryPage = () => {
amount: `${isStableCoin(data.tokenSymbol) ? `$${formatAmount(data.amount)}` : `${formatAmount(data.amount)} ${data.tokenSymbol}`}`,
recipientAddress: data.address ?? '',
recipientAddressFormatter: (address: string) => {
const sanitizedAddressOrName = isAddress(address) ? printableAddress(address) : address
return `To ${sanitizedAddressOrName}`
return (
<>
To <AddressLink address={address} />
</>
)
},
status: transactionStatus,
transactionDetails: {
Expand Down
8 changes: 5 additions & 3 deletions src/app/[...recipient]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import PaymentLayoutWrapper from './payment-layout-wrapper'
import { printableAddress } from '@/utils'
import { isAddress } from 'viem'

function getPreviewUrl(
host: string,
Expand Down Expand Up @@ -60,11 +62,11 @@ export async function generateMetadata({ params }: any) {
previewUrl = getPreviewUrl(host, previewData)

if (amount && token) {
title = `${recipient} is requesting ${amount} ${token.toUpperCase()}`
title = `${isAddress(recipient) ? printableAddress(recipient) : recipient} is requesting ${amount} ${token.toUpperCase()}`
} else if (amount) {
title = `${recipient} is requesting $${amount}`
title = `${isAddress(recipient) ? printableAddress(recipient) : recipient} is requesting $${amount}`
} else {
title = `${recipient} is requesting funds`
title = `${isAddress(recipient) ? printableAddress(recipient) : recipient} is requesting funds`
}

return {
Expand Down
199 changes: 98 additions & 101 deletions src/components/Claim/Link/Initial.view.tsx

Large diffs are not rendered by default.

34 changes: 3 additions & 31 deletions src/components/Claim/Link/Onchain/Confirm.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AddressLink from '@/components/Global/AddressLink'
import FlowHeader from '@/components/Global/FlowHeader'
import Icon from '@/components/Global/Icon'
import MoreInfo from '@/components/Global/MoreInfo'
import PeanutSponsored from '@/components/Global/PeanutSponsored'
import * as consts from '@/constants'
import * as context from '@/context'
import { useWallet } from '@/hooks/wallet/useWallet'
Expand Down Expand Up @@ -187,7 +188,7 @@ export const ConfirmClaimLinkView = ({
</span>
</div>

<div className="flex w-full flex-col items-center justify-center gap-2">
<div className="flex w-full flex-col items-center justify-center gap-2 py-2">
{selectedRoute && (
<div className="flex w-full flex-row items-center justify-between px-2 text-h8 text-grey-1">
<div className="flex w-max flex-row items-center justify-center gap-1">
Expand Down Expand Up @@ -224,36 +225,7 @@ export const ConfirmClaimLinkView = ({
</div>
)}

<div className="flex w-full flex-row items-center justify-between px-2 text-h8 text-grey-1">
<div className="flex w-max flex-row items-center justify-center gap-1">
<Icon name={'gas'} className="h-4 fill-grey-1" />
<label className="font-bold">Fees</label>
</div>
<span className="flex flex-row items-center justify-center gap-1 text-center text-sm font-normal leading-4">
$0.00 <MoreInfo text={'This transaction is sponsored by Peanut! Enjoy!'} />
</span>
</div>

{/* TODO: correct points estimation
<div className="flex w-full flex-row items-center justify-between px-2 text-h8 text-grey-1">
<div className="flex w-max flex-row items-center justify-center gap-1">
<Icon name={'plus-circle'} className="h-4 fill-grey-1" />
<label className="font-bold">Points</label>
</div>
<span className="flex flex-row items-center justify-center gap-1 text-center text-sm font-normal leading-4">
{estimatedPoints < 0 ? estimatedPoints : `+${estimatedPoints}`}
<MoreInfo
text={
estimatedPoints
? estimatedPoints > 0
? `This transaction will add ${estimatedPoints} to your total points balance.`
: 'This transaction will not add any points to your total points balance'
: 'This transaction will not add any points to your total points balance'
}
/>
</span>
</div>
*/}
<PeanutSponsored />

<Button onClick={handleOnClaim} disabled={isLoading} loading={isLoading}>
{isLoading ? loadingState : 'Claim'}
Expand Down
75 changes: 27 additions & 48 deletions src/components/Create/Link/Confirm.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import Divider from '@/components/0_Bruddle/Divider'
import ConfirmDetails from '@/components/Global/ConfirmDetails/Index'
import FlowHeader from '@/components/Global/FlowHeader'
import Icon from '@/components/Global/Icon'
import MoreInfo from '@/components/Global/MoreInfo'
import InfoRow from '@/components/Global/InfoRow'
import PeanutSponsored from '@/components/Global/PeanutSponsored'
import { peanutTokenDetails, supportedPeanutChains } from '@/constants'
import * as context from '@/context'
import { useWalletType } from '@/hooks/useWalletType'
Expand All @@ -26,6 +27,7 @@ import {
import * as _consts from '../Create.consts'
import { useCreateLink } from '../useCreateLink'
import * as Sentry from '@sentry/nextjs'
import AddressLink from '@/components/Global/AddressLink'

export const CreateLinkConfirmView = ({
onNext,
Expand Down Expand Up @@ -261,18 +263,21 @@ export const CreateLinkConfirmView = ({
{createType == 'link'
? 'Send to Anyone'
: createType == 'direct'
? `Send to ${validateEnsName(recipient.name) ? recipient.name : printableAddress(recipient.address ?? '')}`
? `Send to ${validateEnsName(recipient.name) ? recipient.name : <AddressLink address={recipient.address ?? ''} />}`
: `Send to ${recipient.name}`}
</Card.Title>
<Card.Description>
{/* TODO: use addresslink */}
{createType === 'link' &&
'Make a payment with the link. Send the link to the recipient. They will be able to claim the funds in any token on any chain from the link.'}
{createType === 'email_link' &&
`You will send an email to ${recipient.name ?? recipient.address} containing a link. They will be able to claim the funds in any token on any chain from the link.`}
{createType === 'sms_link' &&
`You will send a text message to ${recipient.name ?? recipient.address} containing a link. They will be able to claim the funds in any token on any chain from the link.`}
{createType === 'direct' &&
`You will send the tokens directly to ${recipient.name ?? recipient.address}. Ensure the recipient address is correct, else the funds might be lost.`}
`You will send the tokens directly to ${
recipient.name ?? <AddressLink address={recipient.address ?? ''} />
}. Ensure the recipient address is correct, else the funds might be lost.`}
</Card.Description>
</Card.Header>
<Card.Content className="space-y-3">
Expand Down Expand Up @@ -325,53 +330,27 @@ export const CreateLinkConfirmView = ({
)}
</div>
)}
{transactionCostUSD !== undefined && (
<div className="flex w-full flex-row items-center justify-between gap-1 px-2 text-h8 text-grey-1">
<div className="flex w-max flex-row items-center justify-center gap-1">
<Icon name={'gas'} className="h-4 fill-grey-1" />
<label className="font-bold">Network cost</label>
</div>
<label className="flex flex-row items-center justify-center gap-1 text-center text-sm font-normal leading-4">
{isPeanutWallet
? '$0'
: transactionCostUSD === 0
? '$0'
: transactionCostUSD < 0.01
{transactionCostUSD !== undefined &&
(!isPeanutWallet ? (
<InfoRow
iconName="gas"
label="Network cost"
value={
transactionCostUSD < 0.01
? '$<0.01'
: `$${formatTokenAmount(transactionCostUSD, 3) ?? 0}`}
<MoreInfo
text={
isPeanutWallet
? 'This transaction is sponsored by peanut! Enjoy!'
: transactionCostUSD > 0
? `This transaction will cost you $${formatTokenAmount(transactionCostUSD, 3)} in network fees.`
: 'This transaction is sponsored by Peanut! Enjoy!'
}
/>
</label>
</div>
)}
</div>
{/* <div className="flex w-full flex-row items-center justify-between px-2 text-h8 text-grey-1">
<div className="flex w-max flex-row items-center justify-center gap-1">
<Icon name={'plus-circle'} className="h-4 fill-grey-1" />
<label className="font-bold">Points</label>
: `$${formatTokenAmount(transactionCostUSD, 3) ?? 0}`
}
moreInfoText={`This transaction will cost you $${
transactionCostUSD < 0.01
? '<0.01'
: `${formatTokenAmount(transactionCostUSD, 3) ?? 0}`
} in network fees.`}
/>
) : (
<PeanutSponsored />
))}
</div>
<span className="flex flex-row items-center justify-center gap-1 text-center text-sm font-normal leading-4">
{estimatedPoints && estimatedPoints < 0 ? estimatedPoints : `+${estimatedPoints}`}
<MoreInfo
text={
estimatedPoints
? estimatedPoints > 0
? `This transaction will add ${estimatedPoints} to your total points balance.`
: estimatedPoints < 0
? `This transaction will cost you ${estimatedPoints} points, but will not cost you any gas fees!`
: 'This transaction will not add any points to your total points balance'
: 'This transaction will not add any points to your total points balance'
}
/>
</span>
</div> */}

<Divider className="my-4" />
<div className="mb-4 flex flex-col gap-2 sm:flex-row-reverse">
<Button loading={isLoading} onClick={handleConfirm} disabled={isLoading}>
Expand Down
43 changes: 26 additions & 17 deletions src/components/Global/AddressLink/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,48 @@ import { usePrimaryName } from '@justaname.id/react'
import Link from 'next/link'
import { useEffect, useState } from 'react'
import { isAddress } from 'viem'
import { printableAddress } from '@/utils'

const AddressLink = ({ address, recipientType }: { address: string; recipientType?: RecipientType }) => {
const [url, setUrl] = useState<string>('')
const [displayAddress, setDisplayAddress] = useState<string>(utils.printableAddress(address))
interface AddressLinkProps {
address: string
className?: string
children?: React.ReactNode
}

const AddressLink = ({ address, className = '' }: AddressLinkProps) => {
const [displayAddress, setDisplayAddress] = useState<string>(
isAddress(address) ? printableAddress(address) : address
)
const [urlAddress, setUrlAddress] = useState<string>(address)

// Look up ENS name for any valid Ethereum address
// Look up ENS name only for Ethereum addresses
const { primaryName: ensName } = usePrimaryName({
address: isAddress(address) ? (address as `0x${string}`) : undefined,
chainId: 1, // Mainnet for ENS lookups
priority: 'onChain',
})

useEffect(() => {
if (recipientType === 'USERNAME') {
setUrl(`${process.env.NEXT_PUBLIC_BASE_URL}/${address}`)
} else {
setUrl(`https://debank.com/profile/${address}`)
}
// Update display: prefer ENS name for addresses, otherwise use as-is
if (isAddress(address) && ensName) {
// for peanut ens names, strip the domain from the displayed string so its just a username (no ens subdomain)
const peanutEnsDomain = process.env.NEXT_PUBLIC_JUSTANAME_ENS_DOMAIN || ''
const normalizedEnsName = ensName.replace(peanutEnsDomain, '').replace(/\.$/, '')

// Update display: prefer ENS name, fallback to shortened address
if (ensName) {
setDisplayAddress(ensName)
setDisplayAddress(normalizedEnsName)
setUrlAddress(ensName)
} else {
setDisplayAddress(utils.printableAddress(address))
setDisplayAddress(isAddress(address) ? printableAddress(address) : address)
}
}, [address, ensName])

return url ? (
<Link className="cursor-pointer underline" href={url} target="_blank">
// Create a simple URL - all identifiers go to /{identifier}
const url = `/${urlAddress}`

return (
<Link className={`cursor-pointer underline ${className}`} href={url} target="_blank">
{displayAddress}
</Link>
) : (
<span>{displayAddress}</span>
)
}

Expand Down
3 changes: 1 addition & 2 deletions src/components/Global/WalletHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ const WalletHeader = ({ className, disabled, hideRewardsWallet = false }: Wallet
}
}, [sortedWallets, isWalletConnected, dispatch, selectedWallet])

// Add primary name resolution
const { primaryName } = usePrimaryName({
address: selectedWallet?.address,
priority: 'onChain',
Expand Down Expand Up @@ -366,7 +365,7 @@ const WalletEntryCard: React.FC<WalletEntryCardProps> = ({
<div className="flex w-full flex-col gap-1">
<div className="flex w-full items-center justify-between">
<div className="space-y-1">
<div className="flex items-center gap-2">
<div className="notranslate flex items-center gap-2" translate="no">
{!isRewardsWallet ? (
isPeanutWallet && username ? (
<p className="text-base font-bold">Peanut Wallet</p>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Global/WalletNavigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ const MobileNav: React.FC<MobileNavProps> = ({ tabs, pathName }) => (
<Link
href={href}
key={name}
translate="no"
className={classNames(
'flex flex-col items-center justify-center object-contain py-2 hover:cursor-pointer',
'notranslate flex flex-col items-center justify-center object-contain py-2 hover:cursor-pointer',
{ 'text-primary-1': pathName === href }
)}
>
Expand Down
16 changes: 12 additions & 4 deletions src/components/Home/WalletCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ function ExistingWalletCard({
onClick,
}: WalletCardWallet) {
const { isWalletConnected } = useWallet()

// exceptionally we don't use AddressLink here because the whole card is clickable
const { primaryName } = usePrimaryName({
address: wallet.address,
priority: 'onChain',
Expand Down Expand Up @@ -330,8 +332,11 @@ function WalletIdentifier({
</p>
)
}

return <p className="truncate text-xl font-black sm:text-2xl">{displayName}</p>
return (
<p className="notranslate truncate text-lg font-black sm:text-xl" translate="no">
{displayName}
</p>
)
}

function getWalletDisplayInfo(
Expand All @@ -348,13 +353,16 @@ function getWalletDisplayInfo(
}

if (wallet.walletProviderType === WalletProviderType.PEANUT) {
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL?.split('://')[1] || 'peanut.me'
return {
Comment on lines +356 to 357
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Potential issue with baseUrl extraction.

The current implementation assumes the environment variable always includes a protocol (like 'https://').

The split operation could fail if the environment variable doesn't contain '://':

- const baseUrl = process.env.NEXT_PUBLIC_BASE_URL?.split('://')[1] || 'peanut.me'
+ const baseUrl = process.env.NEXT_PUBLIC_BASE_URL ? 
+   (process.env.NEXT_PUBLIC_BASE_URL.includes('://') ? 
+     process.env.NEXT_PUBLIC_BASE_URL.split('://')[1] : 
+     process.env.NEXT_PUBLIC_BASE_URL) : 
+   'peanut.me'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL?.split('://')[1] || 'peanut.me'
return {
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL ?
(process.env.NEXT_PUBLIC_BASE_URL.includes('://') ?
process.env.NEXT_PUBLIC_BASE_URL.split('://')[1] :
process.env.NEXT_PUBLIC_BASE_URL) :
'peanut.me'
return {

displayName: (
<>
peanut.me/<span className="font-bold">{username}</span>
<span className="font-bold">
{baseUrl}/{username}
</span>
</>
),
copyText: `peanut.me/${username}`,
copyText: `${baseUrl}/${username}`,
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/components/Payment/History/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default function PaymentHistory({ recipient, history }: PaymentHistoryPro
return (
<div className="space-y-3">
<div className="text-base font-semibold">
Payment history to{' '}
<AddressLink address={recipient.resolvedAddress} recipientType={recipient.recipientType} />
Payment history to <AddressLink address={recipient.identifier} />
</div>
<div className="border-t border-t-black">
{[...history]
Expand Down Expand Up @@ -48,7 +47,6 @@ export default function PaymentHistory({ recipient, history }: PaymentHistoryPro
address={
entry.senderAccount.username || entry.senderAccount.identifier
}
recipientType={entry.senderAccount.isUser ? 'USERNAME' : undefined}
/>{' '}
<br className="md:hidden" /> <span className="hidden md:inline">|</span>{' '}
Status: {entry.status}
Expand Down
Loading
Loading