dev #2828
openUpdated by Najmul Hasan 8 months ago
- % Done changed from 0 to 90
- Changes Made
- In ToolAuthorAndVideoClient.tsx (for rendering delay):
Memoized the fetchData function using useMemo to prevent unnecessary re-creations and API calls.
Added error handling with a fallback to empty data (setData([])) to ensure rendering continues on failures.
Simplified useEffect to depend only on the memoized fetchData.
-
In AuthorVerified.tsx (for both issues):
- Rendering Delay:
Removed conditional rendering around the dropdown content; now always renders the list but controls visibility with CSS (max-h-96 opacity-100 visible vs. max-h-0 opacity-0 invisible overflow-hidden).
Improved keys in map loops for stability (using userId or userName fallback).
Retained Image and Link for consistency with Next.js optimizations.
Close on Outside Click:
Added useRef to reference the dropdown container.
Added useEffect to listen for mousedown events on the document, closing the dropdown if the click is outside the ref.
Updated by Najmul Hasan 8 months ago
- Status changed from In Progress to Complete
- % Done changed from 90 to 100