From 03110b13e93121397dd51899890fef07588ad26e Mon Sep 17 00:00:00 2001 From: Hugo Montenegro Date: Tue, 9 Sep 2025 13:02:46 +0200 Subject: [PATCH 1/4] feat: add support page with layout and basic structure --- src/app/[...recipient]/error.tsx | 12 ++++++++++- src/app/support/layout.tsx | 11 ++++++++++ src/app/support/page.tsx | 30 +++++++++++++++++++++++++++ src/components/LandingPage/Footer.tsx | 6 ++++++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/app/support/layout.tsx create mode 100644 src/app/support/page.tsx diff --git a/src/app/[...recipient]/error.tsx b/src/app/[...recipient]/error.tsx index 56602c920..5bed0237d 100644 --- a/src/app/[...recipient]/error.tsx +++ b/src/app/[...recipient]/error.tsx @@ -2,8 +2,11 @@ import { Button, Card } from '@/components/0_Bruddle' import { useEffect } from 'react' +import { useRouter } from 'next/navigation' export default function PaymentError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { + const router = useRouter() + useEffect(() => { console.error(error) }, [error]) @@ -16,10 +19,17 @@ export default function PaymentError({ error, reset }: { error: Error & { digest {error.message || 'An error occurred while loading the payment page.'} - + + ) diff --git a/src/app/support/layout.tsx b/src/app/support/layout.tsx new file mode 100644 index 000000000..d8b6574d9 --- /dev/null +++ b/src/app/support/layout.tsx @@ -0,0 +1,11 @@ +import React from 'react' +import { generateMetadata } from '@/app/metadata' + +export const metadata = generateMetadata({ + title: 'Support | Peanut - Instant Global P2P Payments', + description: 'Get help and support for Peanut. Find answers to your questions about our P2P digital dollar payment app for fast, global transfers.', +}) + +export default function SupportLayout({ children }: { children: React.ReactNode }) { + return children +} diff --git a/src/app/support/page.tsx b/src/app/support/page.tsx new file mode 100644 index 000000000..fcee3e8b9 --- /dev/null +++ b/src/app/support/page.tsx @@ -0,0 +1,30 @@ +'use client' + +import CrispChat from '@/components/CrispChat' +import { useEffect } from 'react' + +export default function SupportPage() { + useEffect(() => { + // Ensure the page takes full height + document.documentElement.style.height = '100%' + document.body.style.height = '100%' + document.body.style.margin = '0' + document.body.style.padding = '0' + document.body.style.overflow = 'hidden' + + // Cleanup on unmount + return () => { + document.documentElement.style.height = '' + document.body.style.height = '' + document.body.style.margin = '' + document.body.style.padding = '' + document.body.style.overflow = '' + } + }, []) + + return ( +
+ +
+ ) +} diff --git a/src/components/LandingPage/Footer.tsx b/src/components/LandingPage/Footer.tsx index 39856b799..b82cb839d 100644 --- a/src/components/LandingPage/Footer.tsx +++ b/src/components/LandingPage/Footer.tsx @@ -58,6 +58,12 @@ const Footer = () => { > Docs + + Support + Date: Tue, 9 Sep 2025 13:23:41 +0200 Subject: [PATCH 2/4] support page --- src/app/(mobile-ui)/layout.tsx | 8 +++-- src/app/support/layout.tsx | 11 ------- src/app/support/page.tsx | 30 ------------------- src/components/LandingPage/Footer.tsx | 17 ++--------- .../LandingPage/securityBuiltIn.tsx | 1 + 5 files changed, 10 insertions(+), 57 deletions(-) delete mode 100644 src/app/support/layout.tsx delete mode 100644 src/app/support/page.tsx diff --git a/src/app/(mobile-ui)/layout.tsx b/src/app/(mobile-ui)/layout.tsx index 49ad5cc2c..f886bb3fd 100644 --- a/src/app/(mobile-ui)/layout.tsx +++ b/src/app/(mobile-ui)/layout.tsx @@ -21,7 +21,8 @@ import { useEffect, useMemo, useState } from 'react' import { twMerge } from 'tailwind-merge' import '../../styles/globals.css' -const publicPathRegex = /^\/(request\/pay|claim|pay\/.+$)/ +// Allow access to some public paths without authentication +const publicPathRegex = /^\/(request\/pay|claim|pay\/.+$|support)/ const Layout = ({ children }: { children: React.ReactNode }) => { const pathName = usePathname() @@ -80,7 +81,10 @@ const Layout = ({ children }: { children: React.ReactNode }) => { } }, []) - if (!isReady || (isFetchingUser && !user && !hasToken)) { + // Allow access to public paths without authentication + const isPublicPath = publicPathRegex.test(pathName) + + if (!isReady || (isFetchingUser && !user && !hasToken && !isPublicPath)) { return (
diff --git a/src/app/support/layout.tsx b/src/app/support/layout.tsx deleted file mode 100644 index d8b6574d9..000000000 --- a/src/app/support/layout.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react' -import { generateMetadata } from '@/app/metadata' - -export const metadata = generateMetadata({ - title: 'Support | Peanut - Instant Global P2P Payments', - description: 'Get help and support for Peanut. Find answers to your questions about our P2P digital dollar payment app for fast, global transfers.', -}) - -export default function SupportLayout({ children }: { children: React.ReactNode }) { - return children -} diff --git a/src/app/support/page.tsx b/src/app/support/page.tsx deleted file mode 100644 index fcee3e8b9..000000000 --- a/src/app/support/page.tsx +++ /dev/null @@ -1,30 +0,0 @@ -'use client' - -import CrispChat from '@/components/CrispChat' -import { useEffect } from 'react' - -export default function SupportPage() { - useEffect(() => { - // Ensure the page takes full height - document.documentElement.style.height = '100%' - document.body.style.height = '100%' - document.body.style.margin = '0' - document.body.style.padding = '0' - document.body.style.overflow = 'hidden' - - // Cleanup on unmount - return () => { - document.documentElement.style.height = '' - document.body.style.height = '' - document.body.style.margin = '' - document.body.style.padding = '' - document.body.style.overflow = '' - } - }, []) - - return ( -
- -
- ) -} diff --git a/src/components/LandingPage/Footer.tsx b/src/components/LandingPage/Footer.tsx index b82cb839d..4dec40861 100644 --- a/src/components/LandingPage/Footer.tsx +++ b/src/components/LandingPage/Footer.tsx @@ -50,27 +50,16 @@ const Footer = () => {
- - Docs - - + Support - Privacy + Docs Date: Tue, 9 Sep 2025 13:29:40 +0200 Subject: [PATCH 3/4] added footer btn --- src/components/LandingPage/securityBuiltIn.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/LandingPage/securityBuiltIn.tsx b/src/components/LandingPage/securityBuiltIn.tsx index 78316c642..14e142e30 100644 --- a/src/components/LandingPage/securityBuiltIn.tsx +++ b/src/components/LandingPage/securityBuiltIn.tsx @@ -82,6 +82,18 @@ export function SecurityBuiltIn() { > {feature.description}

+ {feature.id === 3 && ( +
+ + + +
+ )}
))} From 4e38ebb159f7179ff996b16999e59ae71ae9ae6e Mon Sep 17 00:00:00 2001 From: Hugo Montenegro Date: Tue, 9 Sep 2025 13:43:18 +0200 Subject: [PATCH 4/4] prettier my darling --- src/app/[...recipient]/error.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/app/[...recipient]/error.tsx b/src/app/[...recipient]/error.tsx index 5bed0237d..194db40b7 100644 --- a/src/app/[...recipient]/error.tsx +++ b/src/app/[...recipient]/error.tsx @@ -6,7 +6,7 @@ import { useRouter } from 'next/navigation' export default function PaymentError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { const router = useRouter() - + useEffect(() => { console.error(error) }, [error]) @@ -23,11 +23,7 @@ export default function PaymentError({ error, reset }: { error: Error & { digest -