mirror of
https://github.com/ClipFusion-org/clipfusion.git
synced 2025-08-03 16:55:08 +00:00
git commit hash is now short on phones and long on desktops and tablets
This commit is contained in:
parent
3a8c07b5df
commit
8b5b67522d
@ -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 (
|
||||
<div className="p-5 w-full h-full">
|
||||
@ -48,9 +50,9 @@ export default function Settings(): ReactNode {
|
||||
</AscendingCard>
|
||||
</Link>
|
||||
<Link className="text-sm text-muted-foreground flex justify-center" target="_blank" href={
|
||||
`https://github.com/ClipFusion-org/clipfusion/commit/${getBuildID()}`
|
||||
`https://github.com/ClipFusion-org/clipfusion/commit/${buildID}`
|
||||
}>
|
||||
{getVersion()} ({getBuildID()})
|
||||
{getVersion()} ({shortBuildId ? buildID?.slice(0, 7) : buildID})
|
||||
</Link>
|
||||
</div>
|
||||
</WideContainer>
|
||||
|
@ -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<boolean | undefined>(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)
|
||||
}, []);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user