One Calendar is a privacy-first calendar web app built with Next.js. It has modern security features, including e2ee, password-protected sharing, and self-destructing share links 📅 calendar.xyehr.cn
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: update

authored by

Evan Huang and committed by
GitHub
bdced338 23c5c487

+8 -7
+8 -7
app/(app)/app/page.tsx
··· 1 + import { useEffect, useState } from "react"; 1 2 import Calendar from "@/components/Calendar"; 2 3 import { useIsMobile } from "@/hooks/use-mobile"; 3 - import React, { useState } from "react" 4 4 5 5 export default function Home() { 6 6 const isMobile = useIsMobile(); 7 - const language = navigator.language; 7 + const [isChinese, setIsChinese] = useState(false); 8 + 9 + useEffect(() => { 10 + const lang = navigator.language; 11 + setIsChinese(lang.startsWith("zh")); 12 + }, []); 8 13 9 14 return ( 10 15 <div> 11 16 {isMobile ? ( 12 17 <div> 13 - {language.startsWith("zh") ? ( 14 - <p>请使用电脑打开此页面</p> 15 - ) : ( 16 - <p>Please open this page on a computer</p> 17 - )} 18 + <p>{isChinese ? "请使用电脑打开此页面" : "Please open this page on a computer"}</p> 18 19 </div> 19 20 ) : ( 20 21 <Calendar />