idk what i changed
This commit is contained in:
+6
-4
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user