Skip to content

Commit

Permalink
Locked scroll in merch popup overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahan-Daksh committed Aug 4, 2024
1 parent d83ab97 commit a0b35a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/assets/styles/pages/layouts/Merch.css
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ font-style: normal;
opacity: 0.7;
}

.no-scroll{
overflow: hidden;
}

/* Mobile-specific styles */

@media (max-width: 600px) {
Expand Down
7 changes: 2 additions & 5 deletions src/pages/layouts/Merch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ export default function Merch() {
const handleCardClick = (product) => {
setSelectedProduct(product);
setCurrentImageIndex(0); // Reset image index
document.body.style.overflow = 'hidden'; // Prevent background scroll
};

const handleClosePopup = () => {
setSelectedProduct(null);
document.body.style.overflow = 'auto'; // Restore background scroll
};

const handleThumbnailClick = (index) => {
Expand Down Expand Up @@ -78,11 +80,6 @@ export default function Merch() {
>
<motion.div
className="merch-popup"
style={{
backgroundColor: "black",
color: "white",
borderColor: "white",
}}
initial={{ y: "-100vh" }}
animate={{ y: 0 }}
exit={{ y: "100vh" }}
Expand Down

0 comments on commit a0b35a5

Please sign in to comment.