diff --git a/components/banners.js b/components/banners.js index a6956e8a..78102d1f 100644 --- a/components/banners.js +++ b/components/banners.js @@ -8,7 +8,7 @@ import { useToast } from '../components/toast' import { BALANCE_LIMIT_MSATS } from '../lib/constants' import { msatsToSats, numWithUnits } from '../lib/format' -export function WelcomeBanner () { +export function WelcomeBanner ({ Banner }) { const me = useMe() const toaster = useToast() const [hidden, setHidden] = useState(true) @@ -42,16 +42,18 @@ export function WelcomeBanner () { if (hidden) return null - return ( - - - 👋 Welcome to Stacker News! - -

- To get started, check out our{' '} - FAQs or{' '} - content guidelines, or go ahead and{' '} - { + return Banner + ? + : ( + + + 👋 Welcome to Stacker News! + +

+ To get started, check out our{' '} + FAQs or{' '} + content guidelines, or go ahead and{' '} + { me ? ( make a post @@ -63,7 +65,38 @@ export function WelcomeBanner () { ) }. -

+

+
) +} + +export function MadnessBanner ({ handleClose }) { + const me = useMe() + return ( + + + ⚡️ Million Sat Madness Is Here! + + {me + ? ( +
+
+ We're giving away 3 million sats to the top Stacker News contributors in March. See the leaderboard! +
+
+ How does Million Sat Madness work? Click here. +
+
+ ) + : ( +
+
+ We're giving away 3 million sats to the top Stacker News contributors in March. Sign up! +
+
+ Need help? Check out our FAQs. +
+
+ )}
) } diff --git a/pages/~/index.js b/pages/~/index.js index 195ea3ff..05c51e7a 100644 --- a/pages/~/index.js +++ b/pages/~/index.js @@ -4,7 +4,7 @@ import Items from '../../components/items' import Layout from '../../components/layout' import { SUB_FULL, SUB_ITEMS } from '../../fragments/subs' import Snl from '../../components/snl' -import { WelcomeBanner } from '../../components/banners' +import { MadnessBanner, WelcomeBanner } from '../../components/banners' import { useQuery } from '@apollo/client' import PageLoading from '../../components/page-loading' import TerritoryHeader from '../../components/territory-header' @@ -29,7 +29,7 @@ export default function Sub ({ ssrData }) { : ( <> - + )} diff --git a/prisma/migrations/20240304224326_show_madness_banner/migration.sql b/prisma/migrations/20240304224326_show_madness_banner/migration.sql new file mode 100644 index 00000000..1e8d7bd2 --- /dev/null +++ b/prisma/migrations/20240304224326_show_madness_banner/migration.sql @@ -0,0 +1 @@ +UPDATE users SET "hideWelcomeBanner" = false; \ No newline at end of file