mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 22:59:11 +03:00
Add year to the footer.
This commit is contained in:
1 parent
35286ed464
commit
ee9966040a
1 file changed
+10
@@ -4,6 +4,7 @@ import Link from 'next/link'
|
||||
import { useRouter } from 'next/router'
|
||||
import { Badge, IconDiscord, IconGitHubSolid, IconTwitterX, IconYoutubeSolid, cn } from 'ui'
|
||||
import SectionContainer from '../Layouts/SectionContainer'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
import * as supabaseLogoWordmarkDark from 'common/assets/images/supabase-logo-wordmark--dark.png'
|
||||
import * as supabaseLogoWordmarkLight from 'common/assets/images/supabase-logo-wordmark--light.png'
|
||||
@@ -19,6 +20,14 @@ interface Props {
|
||||
const Footer = (props: Props) => {
|
||||
const { pathname } = useRouter()
|
||||
|
||||
const [year, setYear] = useState(new Date().getFullYear())
|
||||
|
||||
useEffect(() => {
|
||||
fetch('https://getfullyear.com/api/year')
|
||||
.then((response) => response.json())
|
||||
.then((data) => setYear(data.year))
|
||||
}, [])
|
||||
|
||||
const isDarkLaunchWeek = useDarkLaunchWeeks()
|
||||
const isGAWeek = pathname.includes('/ga-week')
|
||||
const forceDark = isDarkLaunchWeek
|
||||
@@ -164,6 +173,7 @@ const Footer = (props: Props) => {
|
||||
</div>
|
||||
<div className="border-default mt-32 flex justify-between border-t pt-8">
|
||||
<small className="small">© Supabase Inc</small>
|
||||
<small>{year}</small>
|
||||
<div className={cn(forceDark && 'hidden')}>
|
||||
<ThemeToggle forceDark={forceDark} />
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user