mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 20:35:07 +03:00
## Context PR mainly adds a change to allow users to dismiss an incident banner Am also taking this time to consolidate `IncidentBanner` and `MaintenanceBanner` into a single component `StatusPageBanner` so that the logic for rendering either component is more clearer. ## Intended behaviour (should be covered by e2e tests) - Incident banner shows if there are incidents with impact !== 'none' - Incident banner still takes precedence over Maintanence banner (if there's both incident + maintenence events) - Dismissing the incident banner will subsequently show the maintenance banner if the maintenance hasn't been dismissed before (just to make sure that the user doesn't miss any comms) - Incident banner will not be dismissible if there's an override (via feature flag or env var) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Unified status page banner showing incident or maintenance notifications, with dismissible banners that persist across sessions; incident notices take precedence over maintenance. * **Refactor** * Replaced separate incident and maintenance banners with a single consolidated StatusPageBanner component. * **Tests** * Added end-to-end tests covering banner visibility, precedence, and dismissal behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
25 lines
864 B
TypeScript
25 lines
864 B
TypeScript
import { useFlag } from 'common'
|
|
import { ClockSkewBanner } from 'components/layouts/AppLayout/ClockSkewBanner'
|
|
import { NoticeBanner } from 'components/layouts/AppLayout/NoticeBanner'
|
|
import { StatusPageBanner } from 'components/layouts/AppLayout/StatusPageBanner'
|
|
import { PropsWithChildren } from 'react'
|
|
|
|
import { OrganizationResourceBanner } from '../Organization/HeaderBanner'
|
|
|
|
export const AppBannerWrapper = ({ children }: PropsWithChildren<{}>) => {
|
|
const showNoticeBanner = useFlag('showNoticeBanner')
|
|
const clockSkewBanner = useFlag('clockSkewBanner')
|
|
|
|
return (
|
|
<div className="flex flex-col">
|
|
<div className="flex-shrink-0">
|
|
<StatusPageBanner />
|
|
{showNoticeBanner && <NoticeBanner />}
|
|
<OrganizationResourceBanner />
|
|
{clockSkewBanner && <ClockSkewBanner />}
|
|
</div>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|