mirror of
https://github.com/supabase/supabase.git
synced 2026-05-07 09:20:21 -04:00
551f334446
## Summary - Adds a hardcoded `BANNER_EXPIRES_AT` constant to `NoticeBanner` so long-lived tabs running an old client bundle stop displaying outdated notices once the relevant date passes. - Self-suppresses on every bundle that ever shipped — no server-side flag flip, no refresh, no over-suppression on unrelated deploys. - The existing `showNoticeBanner` ConfigCat boolean stays in place as the emergency kill-switch. For future banners, set `BANNER_EXPIRES_AT` to the time the notice should stop rendering (e.g. end of a maintenance window, or a generous tail after a TOS effective date). Closes [FE-3175](https://linear.app/supabase/issue/FE-3175/suppress-stale-maintenance-banner-on-old-client-bundles). ## Test plan - [x] Locally set `BANNER_EXPIRES_AT` to a past date and confirm the banner does not render. - [x] Set it to a future date and confirm the banner renders as before. - [x] Confirm flipping `showNoticeBanner` off in ConfigCat still hides the banner. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added automatic expiration for notice banners, ensuring outdated notices no longer display after a specified date. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Writing components
Where to create your components
- For components that declare the general structure and layout of a page:
/components/layouts/xxx
- For components that are tightly coupled to a specific interface:
/components/interfaces/xxx
- For components that are meant to be reusable across multiple pages:
/components/ui/xxx
- Note: We're gradually moving files out of the
to-be-cleanedfolder into the respective folders as we refactor
Component structure
- If a component has constants and utility methods that are tightly coupled to itself, keep them close to the component and enclose them in a folder with an
index.tsxas an entry point - Otherwise it can just be a file on its own
- For example:
-
components/ui - SampleComponentA - SampleComponentA.tsx - SampleComponentA.constants.ts - SampleComponentA.utils.ts - SampleComponentA.types.ts - index.ts - SampleComponentB.tsx
-
Template for building components
// Declare the prop types of your component
interface ComponentAProps {
sampleProp: string
}
// Name your component accordingly
const ComponentA = ({ sampleProp }: ComponentAProps) => {
return <div>ComponentA: {sampleProp}</div>
}
export default ComponentA