Skip to content

Commit baa2157

Browse files
committed
[TOOL-2808] Add back freewallets announcement banner + hide it after 31st Dec 2024 (#5814)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces the `UnlimitedWalletsBanner` component, which displays a promotional banner for free in-app wallets until December 31, 2024, replacing placeholder comments in the layout files. ### Detailed summary - Added import of `UnlimitedWalletsBanner` in `apps/dashboard/src/pages/_app.tsx`. - Replaced placeholder comment with `<UnlimitedWalletsBanner />` in `apps/dashboard/src/pages/_app.tsx`. - Added import of `UnlimitedWalletsBanner` in `apps/dashboard/src/app/layout.tsx`. - Replaced placeholder comment with `<UnlimitedWalletsBanner />` in `apps/dashboard/src/app/layout.tsx`. - Created `UnlimitedWalletsBanner` component in `apps/dashboard/src/components/notices/AnnouncementBanner.tsx` that hides after December 31, 2024. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent df03dbd commit baa2157

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

apps/dashboard/src/app/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import PlausibleProvider from "next-plausible";
77
import { Inter } from "next/font/google";
88
import NextTopLoader from "nextjs-toploader";
99
import { Suspense } from "react";
10+
import { UnlimitedWalletsBanner } from "../components/notices/AnnouncementBanner";
1011
import { OpCreditsGrantedModalWrapperServer } from "../components/onboarding/OpCreditsGrantedModalWrapperServer";
1112
import { EnsureValidConnectedWalletLoginServer } from "./components/EnsureValidConnectedWalletLogin/EnsureValidConnectedWalletLoginServer";
1213
import { PostHogProvider } from "./components/root-providers";
@@ -71,7 +72,7 @@ export default function RootLayout({
7172
fontSans.variable,
7273
)}
7374
>
74-
{/* Banner goes here */}
75+
<UnlimitedWalletsBanner />
7576
<AppRouterProviders>
7677
{children}
7778
<Suspense fallback={null}>

apps/dashboard/src/components/notices/AnnouncementBanner.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22
import { Button } from "@/components/ui/button";
33
import { TrackedLinkTW } from "@/components/ui/tracked-link";
4+
import { isAfter } from "date-fns";
45
import { useLocalStorage } from "hooks/useLocalStorage";
56
import { ChevronRightIcon, XIcon } from "lucide-react";
67
import { useSelectedLayoutSegment } from "next/navigation";
@@ -56,3 +57,20 @@ export function AnnouncementBanner(props: {
5657
</div>
5758
);
5859
}
60+
61+
export function UnlimitedWalletsBanner() {
62+
// hide banner after 31st December 2024
63+
const shouldHideBanner = isAfter(new Date(), new Date("31 Dec 2024"));
64+
65+
if (shouldHideBanner) {
66+
return null;
67+
}
68+
69+
return (
70+
<AnnouncementBanner
71+
href="/team/~/~/settings/billing?coupon=FREEWALLETS24"
72+
label='Claim 12 months of free in-app wallets. Use code "FREEWALLETS24". Redeem offer by December 31st!'
73+
trackingLabel="unlimited-wallets"
74+
/>
75+
);
76+
}

apps/dashboard/src/pages/_app.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import type { ThirdwebNextPage } from "utils/types";
2222
import chakraTheme from "../theme";
2323
import "@/styles/globals.css";
2424
import { DashboardRouterTopProgressBar } from "@/lib/DashboardRouter";
25+
import { UnlimitedWalletsBanner } from "../components/notices/AnnouncementBanner";
2526

2627
const inter = interConstructor({
2728
subsets: ["latin"],
@@ -259,7 +260,7 @@ const ConsoleApp = memo(function ConsoleApp({
259260
/>
260261

261262
<DashboardRouterTopProgressBar />
262-
{/* Banner goes here */}
263+
<UnlimitedWalletsBanner />
263264

264265
<TailwindTheme>
265266
<ChakraProvider theme={chakraThemeWithFonts}>

0 commit comments

Comments
 (0)