idk what i changed

This commit is contained in:
2026-01-29 05:38:39 -08:00
parent ffd5cd09d9
commit 6483d6a8fc
+6 -4
View File
@@ -13,8 +13,8 @@ import "./App.css";
export default function Homepage() {
const navigate = useNavigate();
const dialogRef = useRef(null);
const blockbusterButtonRef = useRef(null);
const dialogRef = useRef<HTMLDialogElement>(null);
const blockbusterButtonRef = useRef<HTMLButtonElement>(null);
const isTouchDevice = () =>
"ontouchstart" in window || navigator.maxTouchPoints > 0;
@@ -28,11 +28,12 @@ export default function Homepage() {
const [showDeclineQ, setShowDeclineQ] = useState(false);
const openPopup = () => {
dialogRef.current.showModal();
dialogRef.current?.showModal();
// Wait for layout to settle
requestAnimationFrame(() => {
const button = blockbusterButtonRef.current;
if (!button) return;
const rect = button.getBoundingClientRect();
button.style.left = `${rect.left}px`;
@@ -45,6 +46,7 @@ export default function Homepage() {
* ------------------------------------------------------------------ */
const moveButton = () => {
const button = blockbusterButtonRef.current;
if (!button) return;
const buttonRect = button.getBoundingClientRect();
@@ -61,7 +63,7 @@ export default function Homepage() {
};
const handleRunawayPress = (event) => {
const handleRunawayPress = (event: React.MouseEvent<HTMLButtonElement> | React.TouchEvent<HTMLButtonElement>) => {
if (isTouchDevice()) {
event.preventDefault();
event.stopPropagation();