Skip to content

Commit

Permalink
fix: resolve server-side rendering issue with Mac detection in Footer
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Feb 13, 2025
1 parent 2164321 commit e55a60c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/(main)/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"use client"

import pack from "@/package.json"
import { useTranslations } from "next-intl"

import { useEffect, useState } from "react"
const GITHUB_URL = "https://github.com/hamster1963/nezha-dash"
const PERSONAL_URL = "https://buycoffee.top"

Expand All @@ -27,7 +29,11 @@ export default function Footer() {
const t = useTranslations("Footer")
const version = pack.version
const currentYear = new Date().getFullYear()
const isMac = /macintosh|mac os x/i.test(navigator.userAgent)
const [isMac, setIsMac] = useState(true)

useEffect(() => {
setIsMac(/macintosh|mac os x/i.test(navigator.userAgent))
}, [])

return (
<footer className="mx-auto w-full max-w-5xl flex items-center justify-between">
Expand Down

0 comments on commit e55a60c

Please sign in to comment.