diff --git a/src/app/components/DebugFooter.js b/src/app/components/DebugFooter.js index 31c1612..bdb1ca8 100644 --- a/src/app/components/DebugFooter.js +++ b/src/app/components/DebugFooter.js @@ -2,14 +2,18 @@ import { useEffect, useRef, useState } from 'react'; +// Where the sha links to. Hard-coded rather than derived from a git remote: +// the remote is a build-machine detail, the public repo is a product fact. +const REPO_URL = 'https://github.com/tiennm99/vngeoguessr'; + // Footer credit plus build stamp, rendered on every page: who made this, and // which commit is this deployment? // // An in-flow strip at the bottom of the body's sticky-footer column, not a // fixed overlay: it owns its own row (and the home-indicator safe area), so // it never overlaps the game's panorama, map, or action bar, and no layer -// needs a z-index to win over it. Clicking the sha copies the FULL value -// (the label shows the short form). +// needs a z-index to win over it. The sha label opens that commit on GitHub; +// the button beside it copies the FULL sha (the label shows the short form). // // Height is --footer-h (36px) rather than the 44px touch floor: this strip is // a band taken out of the game's non-scrolling surface, where in landscape @@ -17,6 +21,7 @@ import { useEffect, useRef, useState } from 'react'; // minimum, and both targets stay wide. export default function DebugFooter() { const sha = process.env.NEXT_PUBLIC_COMMIT_SHA || 'unknown'; + const hasSha = sha !== 'unknown'; const [copied, setCopied] = useState(false); const resetTimerRef = useRef(null); @@ -35,34 +40,58 @@ export default function DebugFooter() { } }; + // Every footer target shares this: --footer-h tall so the tap area comes + // from padding rather than the deliberately tiny label. Horizontal padding + // is per-target, so the sha and its copy button can sit tight together + // while each still spans the full strip height. + const targetClass = + 'flex min-h-(--footer-h) items-center justify-center rounded-md text-[11px] leading-none text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring'; + return ( -