Skip to content

Commit 7ed9dda

Browse files
feat(frontend): add blog banner component (#80)
* feat(frontend): add blog banner component * fix(frontend): simplify blog banner text and add period
1 parent e902721 commit 7ed9dda

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

frontend/app/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { BlockStateTracker } from '@/components/block-state-tracker'
22
import { BlockTimeExecutionTracker } from '@/components/block-time-tracker'
3+
import { BlogBanner } from '@/components/common/blog-banner'
34
import { PageHeader } from '@/components/common/page-header'
45
import { SectionSeparator } from '@/components/common/section-separator'
56
import { HotAccountsBubbleMap } from '@/components/hot-accounts-bubble-map'
@@ -11,6 +12,7 @@ import { CornerDecorationsContainer } from '@/components/ui/corner-decorations-c
1112
export default function Home() {
1213
return (
1314
<div className="min-h-screen text-white font-sans">
15+
<BlogBanner />
1416
<main className="py-6 px-4 max-w-7xl mx-auto sm:py-8 sm:px-6 md:py-12 flex flex-col">
1517
{/* Sections container with continuous left/right borders */}
1618
<CornerDecorationsContainer className="flex flex-col gap-20 border-zinc-800">
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
'use client'
2+
3+
import { X } from 'lucide-react'
4+
import { useState } from 'react'
5+
import { Button } from '@/components/ui/button'
6+
import { ExternalLink } from '@/components/ui/external-link'
7+
8+
const BLOG_POST_URL = 'https://blog.monad.xyz/blog/execution-events-sdk'
9+
10+
export function BlogBanner() {
11+
const [isVisible, setIsVisible] = useState(true)
12+
13+
if (!isVisible) return null
14+
15+
return (
16+
<div className="w-full bg-brand-purple-primary">
17+
<div className="flex items-center justify-center px-4 py-2 text-sm font-medium text-white relative">
18+
<span>
19+
Built with the Monad Execution Events SDK. Read the blog post{' '}
20+
<ExternalLink
21+
href={BLOG_POST_URL}
22+
className="underline hover:text-white/80 transition-colors"
23+
>
24+
here
25+
</ExternalLink>
26+
.
27+
</span>
28+
<Button
29+
variant="ghost"
30+
size="sm"
31+
onClick={() => setIsVisible(false)}
32+
className="absolute right-2 sm:right-4 p-0"
33+
aria-label="Close banner"
34+
>
35+
<X className="h-4 w-4" />
36+
</Button>
37+
</div>
38+
</div>
39+
)
40+
}

frontend/components/ui/button.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const buttonVariants = cva(
99
variant: {
1010
primary: 'rounded-md text-white btn-primary',
1111
secondary: 'rounded-md text-white btn-secondary',
12+
ghost: 'bg-transparent hover:opacity-70 rounded',
1213
},
1314
size: {
1415
default: 'h-9 px-4 py-2',

0 commit comments

Comments
 (0)