From ee9966040ad09d683bfb5cd9fb2d44e7cc013115 Mon Sep 17 00:00:00 2001 From: Ivan Vasilov Date: Thu, 2 Jan 2025 15:22:11 +0100 Subject: [PATCH] Add year to the footer. --- apps/www/components/Footer/index.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/www/components/Footer/index.tsx b/apps/www/components/Footer/index.tsx index 2a51a62668f..9f75b76007b 100644 --- a/apps/www/components/Footer/index.tsx +++ b/apps/www/components/Footer/index.tsx @@ -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) => {
© Supabase Inc + {year}