diff --git a/src/components/FileContributors.tsx b/src/components/FileContributors.tsx index dbaf9ae0deb..f98e4c6eefe 100644 --- a/src/components/FileContributors.tsx +++ b/src/components/FileContributors.tsx @@ -1,5 +1,4 @@ import { useState } from "react" -import { useRouter } from "next/router" import { Avatar, Flex, @@ -9,7 +8,7 @@ import { VStack, } from "@chakra-ui/react" -import type { ChildOnlyProp, FileContributor, Lang } from "@/lib/types" +import type { ChildOnlyProp, FileContributor } from "@/lib/types" import { Button } from "@/components/Buttons" import InlineLink from "@/components/Link" @@ -18,7 +17,6 @@ import Text from "@/components/OldText" import Translation from "@/components/Translation" import { trackCustomEvent } from "@/lib/utils/matomo" -import { getLocaleTimestamp } from "@/lib/utils/time" const ContributorList = ({ children }: Required) => ( @@ -44,16 +42,15 @@ const Contributor = ({ contributor }: ContributorProps) => ( export type FileContributorsProps = FlexProps & { contributors: FileContributor[] - lastEdit: string + lastEditLocaleTimestamp: string } const FileContributors = ({ contributors, - lastEdit, + lastEditLocaleTimestamp, ...props }: FileContributorsProps) => { const [isModalOpen, setModalOpen] = useState(false) - const { locale } = useRouter() const lastContributor: FileContributor = contributors.length ? contributors[0] @@ -102,7 +99,7 @@ const FileContributors = ({ @{lastContributor.login} - , {getLocaleTimestamp(locale as Lang, lastEdit)} + , {lastEditLocaleTimestamp} diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 88d2a8376c3..59fc2a231fd 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,4 +1,3 @@ -import { useRouter } from "next/router" import { useTranslation } from "next-i18next" import { FaDiscord, FaGithub, FaTwitter } from "react-icons/fa" import { IoChevronUpSharp } from "react-icons/io5" @@ -13,13 +12,12 @@ import { Text, } from "@chakra-ui/react" -import type { FooterLink, FooterLinkSection, Lang } from "@/lib/types" +import type { FooterLink, FooterLinkSection } from "@/lib/types" import { BaseLink } from "@/components/Link" import Translation from "@/components/Translation" import { scrollIntoView } from "@/lib/utils/scrollIntoView" -import { getLocaleTimestamp } from "@/lib/utils/time" import { Button } from "./Buttons" @@ -42,11 +40,10 @@ const socialLinks = [ ] type FooterProps = { - lastDeployDate: string + lastDeployLocaleTimestamp: string } -const Footer = ({ lastDeployDate }: FooterProps) => { - const { locale } = useRouter() +const Footer = ({ lastDeployLocaleTimestamp }: FooterProps) => { const { t } = useTranslation("common") const linkSections: FooterLinkSection[] = [ @@ -319,6 +316,7 @@ const Footer = ({ lastDeployDate }: FooterProps) => { fill: "primary.base", }, } + const linkProps = { isPartiallyActive: false, textDecor: "none", @@ -335,7 +333,7 @@ const Footer = ({ lastDeployDate }: FooterProps) => { return ( { borderTop={"1px solid"} borderColor={"body.light"} > - {lastDeployDate && ( - - :{" "} - {getLocaleTimestamp(locale as Lang, lastDeployDate)} - - )} + + : {lastDeployLocaleTimestamp} +