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 {
|
export default function Settings(): ReactNode {
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
|
const shortBuildId = useIsMobile(1024);
|
||||||
|
const buildID = getBuildID();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-5 w-full h-full">
|
<div className="p-5 w-full h-full">
|
||||||
@ -48,9 +50,9 @@ export default function Settings(): ReactNode {
|
|||||||
</AscendingCard>
|
</AscendingCard>
|
||||||
</Link>
|
</Link>
|
||||||
<Link className="text-sm text-muted-foreground flex justify-center" target="_blank" href={
|
<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>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</WideContainer>
|
</WideContainer>
|
||||||
|
@ -2,15 +2,15 @@ import * as React from "react"
|
|||||||
|
|
||||||
const MOBILE_BREAKPOINT = 768
|
const MOBILE_BREAKPOINT = 768
|
||||||
|
|
||||||
export function useIsMobile() {
|
export function useIsMobile(breakpoint: number = MOBILE_BREAKPOINT) {
|
||||||
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
|
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const onResize = () => {
|
const onResize = () => {
|
||||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
setIsMobile(window.innerWidth < breakpoint)
|
||||||
};
|
};
|
||||||
window.addEventListener("resize", onResize)
|
window.addEventListener("resize", onResize)
|
||||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
setIsMobile(window.innerWidth < breakpoint)
|
||||||
return () => window.removeEventListener("resize", onResize)
|
return () => window.removeEventListener("resize", onResize)
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user