diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index e930586..62afa1a 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -14,6 +14,8 @@ import { getBuildID, getVersion } from "@/lib/build"; export default function Settings(): ReactNode { const isMobile = useIsMobile(); + const shortBuildId = useIsMobile(1024); + const buildID = getBuildID(); return (
@@ -48,9 +50,9 @@ export default function Settings(): ReactNode { - {getVersion()} ({getBuildID()}) + {getVersion()} ({shortBuildId ? buildID?.slice(0, 7) : buildID})
diff --git a/src/hooks/use-mobile.ts b/src/hooks/use-mobile.ts index 0a414a4..7302227 100644 --- a/src/hooks/use-mobile.ts +++ b/src/hooks/use-mobile.ts @@ -2,15 +2,15 @@ import * as React from "react" const MOBILE_BREAKPOINT = 768 -export function useIsMobile() { +export function useIsMobile(breakpoint: number = MOBILE_BREAKPOINT) { const [isMobile, setIsMobile] = React.useState(undefined) React.useEffect(() => { const onResize = () => { - setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) + setIsMobile(window.innerWidth < breakpoint) }; window.addEventListener("resize", onResize) - setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) + setIsMobile(window.innerWidth < breakpoint) return () => window.removeEventListener("resize", onResize) }, []);