From b34ca4bee7b86d59c98eb6b8bde107ab33c86eca Mon Sep 17 00:00:00 2001 From: shafu Date: Tue, 19 May 2026 12:45:16 -0400 Subject: [PATCH] Add Poncho banner to home page --- apps/scan/public/poncho-logo-dark.svg | 33 +++++++ apps/scan/public/poncho-logo-light.svg | 31 ++++++ .../src/app/(app)/(home)/(discover)/page.tsx | 4 +- .../(home)/_components/poncho-banner.tsx | 98 +++++++++++++++++++ 4 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 apps/scan/public/poncho-logo-dark.svg create mode 100644 apps/scan/public/poncho-logo-light.svg create mode 100644 apps/scan/src/app/(app)/(home)/_components/poncho-banner.tsx diff --git a/apps/scan/public/poncho-logo-dark.svg b/apps/scan/public/poncho-logo-dark.svg new file mode 100644 index 000000000..bf7cc203a --- /dev/null +++ b/apps/scan/public/poncho-logo-dark.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/scan/public/poncho-logo-light.svg b/apps/scan/public/poncho-logo-light.svg new file mode 100644 index 000000000..cf54a89cc --- /dev/null +++ b/apps/scan/public/poncho-logo-light.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/scan/src/app/(app)/(home)/(discover)/page.tsx b/apps/scan/src/app/(app)/(home)/(discover)/page.tsx index 8e9aaf263..bdb4eed27 100644 --- a/apps/scan/src/app/(app)/(home)/(discover)/page.tsx +++ b/apps/scan/src/app/(app)/(home)/(discover)/page.tsx @@ -5,7 +5,7 @@ import { ErrorBoundary } from 'react-error-boundary'; import { Body, Section } from '@/app/_components/layout/page-utils'; import { OverallStats } from '../(overview)/_components/stats'; -// import { AgentCashAnnouncementBanner } from '../_components/v2-announcement-banner'; +import { PonchoBanner } from '../_components/poncho-banner'; import { DiscoverHeading } from './_components/heading'; import { api, HydrateClient } from '@/trpc/server'; @@ -48,10 +48,10 @@ export default async function DiscoverPage({
+ - {/* */} { + const isDismissed = useSyncExternalStore( + subscribeToDismissedState, + getDismissedSnapshot, + getServerDismissedSnapshot + ); + + if (isDismissed) return null; + + return ( +
+
+ +
+
+
+ +
+
+

+ Poncho +

+

+ Poncho is the easiest way to call every API listed on x402scan +

+
+
+ +
+
+
+ ); +}; + +function subscribeToDismissedState(onStoreChange: () => void) { + window.addEventListener(STORAGE_KEY, onStoreChange); + window.addEventListener('storage', onStoreChange); + + return () => { + window.removeEventListener(STORAGE_KEY, onStoreChange); + window.removeEventListener('storage', onStoreChange); + }; +} + +function getDismissedSnapshot() { + return localStorage.getItem(STORAGE_KEY) === 'true'; +} + +function getServerDismissedSnapshot() { + return false; +}