diff --git a/frontend/.env.example b/frontend/.env.example index ffc2e5b..3d2716a 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -3,4 +3,7 @@ NEXT_PUBLIC_EVENTS_WS_URL="wss://:" # 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" \ No newline at end of file +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" diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx index e657204..bb98abf 100644 --- a/frontend/app/page.tsx +++ b/frontend/app/page.tsx @@ -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' @@ -15,7 +14,7 @@ export default function Home() { return (
- {/* */} +
{/* Sections container with continuous left/right borders */} diff --git a/frontend/components/common/maintenance-banner.tsx b/frontend/components/common/maintenance-banner.tsx index 81b908a..6f6f9b0 100644 --- a/frontend/components/common/maintenance-banner.tsx +++ b/frontend/components/common/maintenance-banner.tsx @@ -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 (
diff --git a/frontend/config/env.ts b/frontend/config/env.ts index fd33f1f..2aff80c 100644 --- a/frontend/config/env.ts +++ b/frontend/config/env.ts @@ -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 } diff --git a/frontend/constants/common.ts b/frontend/constants/common.ts index b0c377d..12d38d4 100644 --- a/frontend/constants/common.ts +++ b/frontend/constants/common.ts @@ -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.'