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; +}