Skip to content

Commit

Permalink
updated videoCard
Browse files Browse the repository at this point in the history
  • Loading branch information
gnehs committed Nov 16, 2023
1 parent 764fee8 commit a5a87c4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/cfp/VideoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@ export default function VideoCard({
setIsMobile(false);
}
}, [width]);
useEffect(() => {
if (open) {
document.body.style.overflow = "hidden";
} else {
document.body.style.overflow = "auto";
}
}, [open]);
const y = useMotionValue(0);
const yVelocity = useVelocity(y);
const zIndex = useMotionValue(open ? 2 : 0);
function checkSwipeToDismiss() {
if (yVelocity.get() > 300) {
if (Math.abs(yVelocity.get()) > 500) {
setOpen(false);
}
}
Expand Down

0 comments on commit a5a87c4

Please sign in to comment.