Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/components/Banners/FusakaBanner/FusakaCountdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useEffect, useState } from "react"
import humanizeDuration from "humanize-duration"
import { useLocale, useTranslations } from "next-intl"
import { useLocale } from "next-intl"

const fusakaDate = new Date("2025-12-03T21:49:11.000Z")
const fusakaDateTime = fusakaDate.getTime()
Expand Down Expand Up @@ -108,9 +108,8 @@ const getTimeLabels = (locale: string): TimeLabels => {
}
}

const FusakaCountdown = () => {
const FusakaCountdown = ({ liveNowText }: { liveNowText: string }) => {
const locale = useLocale()
const t = useTranslations("page-index")
const [timeUnits, setTimeUnits] = useState<TimeUnits>(() => getTimeUnits())
const [labels, setLabels] = useState<TimeLabels>(() => getTimeLabels(locale))

Expand All @@ -129,11 +128,7 @@ const FusakaCountdown = () => {
}, [])

if (timeUnits.isExpired) {
return (
<p className="text-2xl font-extrabold text-white">
{t("page-index-fusaka-live-now")}
</p>
)
return <p className="text-2xl font-extrabold text-white">{liveNowText}</p>
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Banners/FusakaBanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const FusakaBanner = async () => {
br: () => <br className="md:hidden" />,
})}
</p>
<FusakaCountdown />
<FusakaCountdown liveNowText={t("page-index-fusaka-live-now")} />
</div>
</div>
</LinkBox>
Expand Down