diff --git a/app/creator/reader/page.tsx b/app/creator/reader/page.tsx index 7aa332f..1797d0e 100644 --- a/app/creator/reader/page.tsx +++ b/app/creator/reader/page.tsx @@ -2,7 +2,7 @@ import { ArrowLeft2, Setting2 } from 'iconsax-react'; import Image from 'next/image'; -import React, { useState, useEffect, useRef } from 'react'; +import React, { useState, useEffect, useRef, useCallback } from 'react'; import Link from 'next/link'; import HoverCards from '@/components/cards/HoverCards'; import { Button } from '@/components/ui/button'; @@ -20,7 +20,7 @@ export default function Reader() { const videoRefs = useRef<(HTMLVideoElement | null)[]>([]); // Add wheel event handler - const handleWheel = (event: WheelEvent) => { + const handleWheel = useCallback((event: WheelEvent) => { if (transitioning) return; // Scroll down @@ -31,7 +31,7 @@ export default function Reader() { else if (event.deltaY < 0) { handlePreviousPage(); } - }; + }, []); // Add previous page handler const handlePreviousPage = () => { @@ -56,7 +56,7 @@ export default function Reader() { return () => { window.removeEventListener('wheel', handleWheel); }; - }, [currentPageIndex, transitioning]); // Add dependencies + }, [currentPageIndex, transitioning, handleWheel]); // Add dependencies // Content structured to match your design const pages: Page[] = [ @@ -81,10 +81,10 @@ export default function Reader() { <>
"Wade Harper! What is up, old friend! It's been too long, man!" exclaims HANDSOME TWIN #1.
-HANDSOME TWIN #2, more anxious and pushy, quickly interjects, "So do you have it for us?"
+"Wade Harper! What is up, old friend! It's been too long, man!" exclaims HANDSOME TWIN #1.
+HANDSOME TWIN #2, more anxious and pushy, quickly interjects, "So do you have it for us?"
Wade reaches into his breast pocket.
-"Yes, I do."
+"Yes, I do."
Wade considers the
Man, yes! Didn't I tell you not to question this man! I knew he was going to come through for us!" Handsome Twin #1 gloats.
-Handsome Twin #2 sighs in satisfaction. "
"Man, yes! Didn't I tell you not to question this man! I knew he was going to come through for us!" Handsome Twin #1 gloats.
+Handsome Twin #2 sighs in satisfaction. "
Wade hands the device to Handsome Twin #2.
-"You will find all of the credentials you need on the drive. The shipment will arrive at the
+