mirror of
https://github.com/supabase/supabase.git
synced 2026-10-13 13:19:09 +03:00
* design polish * better banner * defensive truncation * better incident banner * better prop names * improve warnings * fix variant * OrganizationResourceBanner * notice banner * improve ClockSkewBanner * add ARIA label * rabbit * lil dot * 📝 Add docstrings to `dnywh/chore/improve-header-banner` (#41526) * 📝 Add docstrings to `dnywh/chore/improve-header-banner` Docstrings generation was requested by @dnywh. * https://github.com/supabase/supabase/pull/41525#issuecomment-3680124020 The following files were modified: * `apps/studio/hooks/misc/useOrganizationRestrictions.ts` * new line --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com> * fix clock docs link * Small nits * Fix URL for grace period warning to point to usage instead of billing * rabbit --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
33 lines
934 B
TypeScript
33 lines
934 B
TypeScript
import { useEffect, useState } from 'react'
|
||
|
||
import { HeaderBanner } from 'components/interfaces/Organization/HeaderBanner'
|
||
import { InlineLink } from 'components/ui/InlineLink'
|
||
import { useClockSkewQuery } from 'data/misc/clock-skew-query'
|
||
import { DOCS_URL } from 'lib/constants'
|
||
|
||
export const ClockSkewBanner = () => {
|
||
const [isClockSkewed, setIsClockSkewed] = useState(false)
|
||
|
||
const { data } = useClockSkewQuery()
|
||
useEffect(() => setIsClockSkewed(!!data), [data])
|
||
|
||
if (!isClockSkewed) return null
|
||
|
||
return (
|
||
<HeaderBanner
|
||
variant="warning"
|
||
title="Your computer’s clock appears to be inaccurate"
|
||
description={
|
||
<>
|
||
This can cause issues with certain features.{' '}
|
||
<InlineLink
|
||
href={`${DOCS_URL}/guides/troubleshooting/jwt-expired-error-in-supabase-dashboard-F06k3x`}
|
||
>
|
||
Learn more
|
||
</InlineLink>
|
||
</>
|
||
}
|
||
/>
|
||
)
|
||
}
|