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.

Update page.tsx

authored by

Evan Huang and committed by
GitHub
6b7d99e5 19f2045d

+13 -2
+13 -2
app/(app)/app/page.tsx
··· 2 2 3 3 import { useEffect, useState } from "react"; 4 4 import Calendar from "@/components/Calendar"; 5 - import { useIsMobile } from "@/hooks/useMobile"; 6 5 7 6 export default function Home() { 8 - const isMobile = useIsMobile(); 7 + const [isMobile, setIsMobile] = useState(false); 9 8 const [isChinese, setIsChinese] = useState(false); 9 + 10 + useEffect(() => { 11 + const checkIfMobile = () => { 12 + setIsMobile(window.innerWidth <= 768); 13 + }; 14 + 15 + checkIfMobile(); 16 + 17 + window.addEventListener("resize", checkIfMobile); 18 + 19 + return () => window.removeEventListener("resize", checkIfMobile); 20 + }, []); 10 21 11 22 useEffect(() => { 12 23 const lang = navigator.language;