Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 29 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
},
{
"source": "/pints",
"destination": "/adag1o/1",
"destination": "https://luma.com/zwh7l3ro",
"permanent": false
},
{
"source": "/events",
"destination": "https://lu.ma/7j6g06rq",
"destination": "https://luma.com/zwh7l3ro",
"permanent": false
}
]
7 changes: 3 additions & 4 deletions src/app/(mobile-ui)/points/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import TransactionAvatarBadge from '@/components/TransactionDetails/TransactionA
import { VerifiedUserLabel } from '@/components/UserHeader'
import { useAuth } from '@/context/authContext'
import { invitesApi } from '@/services/invites'
import { Invite } from '@/services/services.types'
import { generateInvitesShareText } from '@/utils'
import type { Invite } from '@/services/services.types'
import { generateInviteCodeLink, generateInvitesShareText } from '@/utils'
import { useQuery } from '@tanstack/react-query'
import { useRouter } from 'next/navigation'
import { useEffect } from 'react'
Expand All @@ -27,8 +27,7 @@ const PointsPage = () => {
})

const username = user?.user.username
const inviteCode = username ? `${username.toUpperCase()}INVITESYOU` : ''
const inviteLink = `${process.env.NEXT_PUBLIC_BASE_URL}/invite?code=${inviteCode}`
const { inviteCode, inviteLink } = generateInviteCodeLink(username ?? '')

useEffect(() => {
// Re-fetch user to get the latest invitees list for showing heart Icon
Expand Down
32 changes: 29 additions & 3 deletions src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ export default function WithdrawBankPage() {
currency.path?.toLowerCase() === country.toLowerCase()
)?.currencyCode

// non-eur sepa countries that are currently experiencing issues
const isNonEuroSepaCountry = !!(
nonEuroCurrency &&
nonEuroCurrency !== 'EUR' &&
nonEuroCurrency !== 'USD' &&
nonEuroCurrency !== 'MXN'
)

useEffect(() => {
if (!amountToWithdraw) {
// If no amount, go back to main page
Expand Down Expand Up @@ -243,9 +251,27 @@ export default function WithdrawBankPage() {
<ExchangeRate accountType={bankAccount.type} nonEuroCurrency={nonEuroCurrency} />
<PaymentInfoRow hideBottomBorder label="Fee" value={`$ 0.00`} />
</Card>

{isNonEuroSepaCountry && (
<div className="rounded-sm border border-yellow-500 bg-yellow-50 p-4">
<div className="flex items-start gap-3">
<div className="mt-0.5 text-xl">⚠️</div>
<div className="flex-1">
<p className="text-sm font-semibold text-yellow-800">
Service Temporarily Unavailable
</p>
<p className="mt-1 text-xs text-yellow-700">
Withdrawals to {nonEuroCurrency} bank accounts are temporarily unavailable.
Please try again later.
</p>
</div>
</div>
</div>
)}

{error.showError ? (
<Button
disabled={isLoading}
disabled={isLoading || isNonEuroSepaCountry}
onClick={handleCreateAndInitiateOfframp}
loading={isLoading}
shadowSize="4"
Expand All @@ -262,10 +288,10 @@ export default function WithdrawBankPage() {
iconSize={12}
shadowSize="4"
onClick={handleCreateAndInitiateOfframp}
disabled={isLoading || !bankAccount}
disabled={isLoading || !bankAccount || isNonEuroSepaCountry}
className="w-full"
>
Withdraw
{isNonEuroSepaCountry ? 'Temporarily Unavailable' : 'Withdraw'}
</Button>
)}
{error.showError && <ErrorAlert description={error.errorMessage} />}
Expand Down
2 changes: 1 addition & 1 deletion src/app/[...recipient]/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export default function PaymentPage({ recipient, flow = 'request_pay' }: Props)
return (
<div className={twMerge('mx-auto min-h-[inherit] w-full space-y-8 self-center')}>
{!user && parsedPaymentData?.recipient?.recipientType !== 'USERNAME' && (
<div className="absolute left-0 top-0 md:top-18">
<div className="absolute left-0 top-0 z-50 md:top-22 md:z-0">
<GenericBanner
message="THIS FEATURE IS CURRENTLY IN TESTING - ONLY USE WITH SMALL AMOUNTS"
marqueeClassName="flex h-11 items-center justify-center border-b-2 border-black"
Expand Down
18 changes: 16 additions & 2 deletions src/utils/general.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1330,11 +1330,25 @@ export function slugify(text: string): string {
}

export const generateInvitesShareText = (inviteLink: string) => {
return `I’m using Peanut, an invite-only app for easy payments. With it you can pay friends, use merchants, and move money in and out of your bank, even cross-border. Here’s my invite: ${inviteLink}`
return `I'm using Peanut, an invite-only app for easy payments. With it you can pay friends, use merchants, and move money in and out of your bank, even cross-border. Here's my invite: ${inviteLink}`
}

/**
* Generate a deterministic 3-digit suffix from username
* This is purely cosmetic and derived from a hash of the username
*/
export const generateInviteCodeSuffix = (username: string): string => {
const lowerUsername = username.toLowerCase()
// Create a simple hash from the username
const hash = lowerUsername.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0)
// Generate 3 digits between 100-999
const threeDigits = 100 + (hash % 900)
return threeDigits.toString()
}

export const generateInviteCodeLink = (username: string) => {
const inviteCode = `${username.toUpperCase()}INVITESYOU`
const suffix = generateInviteCodeSuffix(username)
const inviteCode = `${username.toUpperCase()}INVITESYOU${suffix}`
const inviteLink = `${consts.BASE_URL}/invite?code=${inviteCode}`
return { inviteLink, inviteCode }
}
Expand Down
Loading