From 5f06db1339a365003c4ce1c94d0a525366ad673b Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Wed, 29 Jul 2026 12:33:46 -0700 Subject: [PATCH] Hide next/prev buttons if not usable --- src/app/main/page.tsx | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/src/app/main/page.tsx b/src/app/main/page.tsx index b5561dc..38f3927 100644 --- a/src/app/main/page.tsx +++ b/src/app/main/page.tsx @@ -53,6 +53,7 @@ export default function HomePage () { const swiperRef = useRef(null) const prevRef = useRef(null) const nextRef = useRef(null) + const [isLocked, setIsLocked] = useState(false) const [recentSlidesPerView, setRecentSlidesPerView] = useState(1) @@ -90,6 +91,13 @@ export default function HomePage () { className='w-full' onSwiper={swiper => { swiperRef.current = swiper + setIsLocked(swiper.isLocked) + }} + onResize={swiper => { + setIsLocked(swiper.isLocked) + }} + onUpdate={swiper => { + setIsLocked(swiper.isLocked) }} onBeforeInit={swiper => { if ( @@ -142,22 +150,24 @@ export default function HomePage () { ) })} -
- - -
+ {!isLocked && ( +
+ + +
+ )} )}