Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ NEXT_PUBLIC_EVENTS_WS_URL="wss://<SERVER_ADDR>:<SERVER_PORT>"

# BlockVision Pro API key for Monad mainnet contract metadata lookups
# Get your API key from https://docs.blockvision.org/
BLOCKVISION_API_KEY="your-api-key-here"
BLOCKVISION_API_KEY="your-api-key-here"

# Set to "true" to show the maintenance banner at the top of the page (default: hidden)
NEXT_PUBLIC_SHOW_MAINTENANCE_BANNER="false"
5 changes: 2 additions & 3 deletions frontend/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { BlockStateTracker } from '@/components/block-state-tracker'
import { BlockTimeExecutionTracker } from '@/components/block-time-tracker'
// Hidden while the maintenance banner is up. Uncomment to restore.
// import { BlogBanner } from '@/components/common/blog-banner'
import { BlogBanner } from '@/components/common/blog-banner'
import { MaintenanceBanner } from '@/components/common/maintenance-banner'
import { PageHeader } from '@/components/common/page-header'
import { SectionSeparator } from '@/components/common/section-separator'
Expand All @@ -15,7 +14,7 @@ export default function Home() {
return (
<div className="min-h-screen text-white font-sans">
<MaintenanceBanner />
{/* <BlogBanner /> */}
<BlogBanner />
<main className="py-6 px-4 max-w-7xl mx-auto sm:py-8 sm:px-6 md:py-12 flex flex-col">
{/* Sections container with continuous left/right borders */}
<CornerDecorationsContainer className="flex flex-col gap-20 border-zinc-800">
Expand Down
13 changes: 8 additions & 5 deletions frontend/components/common/maintenance-banner.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { TriangleAlert } from 'lucide-react'
import { SHOW_MAINTENANCE_BANNER } from '@/constants/common'
import { publicEnv } from '@/config/env'
import {
MAINTENANCE_BANNER_HIGHLIGHT,
MAINTENANCE_BANNER_MESSAGE,
} from '@/constants/common'

export function MaintenanceBanner() {
if (!SHOW_MAINTENANCE_BANNER) return null
if (!publicEnv.SHOW_MAINTENANCE_BANNER) return null

return (
<div className="w-full bg-amber-400 text-zinc-950">
<div className="flex items-center justify-center gap-2 px-4 py-2 text-sm font-medium text-center">
<TriangleAlert className="h-4 w-4 shrink-0" aria-hidden="true" />
<span>
The data stream behind this page is down, so live stats are
unavailable. We are working to bring it back.{' '}
{MAINTENANCE_BANNER_MESSAGE}{' '}
<strong className="font-semibold underline underline-offset-2">
This does not affect the Monad network.
{MAINTENANCE_BANNER_HIGHLIGHT}
</strong>
</span>
</div>
Expand Down
4 changes: 4 additions & 0 deletions frontend/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const publicEnv = {
get EVENTS_WS_URL() {
return getEnvOrThrow('NEXT_PUBLIC_EVENTS_WS_URL')
},
/** Defaults to false (banner hidden) unless set to "true". */
get SHOW_MAINTENANCE_BANNER() {
return process.env.NEXT_PUBLIC_SHOW_MAINTENANCE_BANNER === 'true'
},
}

export { getEnvOrNull, getEnvOrThrow }
9 changes: 6 additions & 3 deletions frontend/constants/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
export const EXPLORER_URL = 'https://monadvision.com'

/**
* Show the maintenance banner at the top of the page.
* Set to false once the data stream is restored.
* Copy for the maintenance banner. The banner is shown only when
* NEXT_PUBLIC_SHOW_MAINTENANCE_BANNER is "true".
*/
export const SHOW_MAINTENANCE_BANNER = true
export const MAINTENANCE_BANNER_MESSAGE =
'The data stream behind this page is down, so live stats are unavailable. We are working to bring it back.'
export const MAINTENANCE_BANNER_HIGHLIGHT =
'This does not affect the Monad network.'
Loading