Skip to content

Commit

Permalink
refactor: optimize height handling in Publications component for bett…
Browse files Browse the repository at this point in the history
…er performance
  • Loading branch information
mirsazzathossain@gmail.com committed Dec 1, 2024
1 parent 3737f9b commit 4b5d895
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/Publications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ export default function Publications({
<div
key={index}
className={
(isExpanded ? " h-auto" : " h-0") +
" overflow-hidden transition-height ease-in-out duration-[400ms]"
"h-0 overflow-hidden transition-height ease-in-out duration-[400ms]"
}
ref={parentRef as any}
style={{
height: isExpanded ? "auto" : "0px",
height: isExpanded ? parentRef.current.clientHeight : 0,
}}
>
<PublicationCard key={index} publication={publication} />
Expand Down

0 comments on commit 4b5d895

Please sign in to comment.