Skip to content

Commit

Permalink
feat: Add show more/less functionality to administrators list (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpqdap committed Jun 23, 2024
1 parent ac3bbd0 commit 2ab4d19
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/features/settings/tenant-details/administrators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ export const Administrators: React.FC<{ administrators: string[] }> = ({ adminis
<b>{admin}</b>
</div>
))}
<div
className={
"mt-2 flex w-full transform cursor-pointer justify-center gap-2 rounded-md border-2 border-altBorder duration-300 animate-in"
}
onClick={() => setShowMore(!showMore)}
>
{showMore ? "Show Less" : "Show More"}
<ChevronUpIcon className={`h-6 w-6 transform duration-300 animate-in ${showMore ? "" : "rotate-180"}`} />
</div>
{administrators.length > DEFAULT_ITEMS_TO_SHOW && (
<div
className={
"mt-2 flex w-full transform cursor-pointer justify-center gap-2 rounded-md border-2 border-altBorder duration-300 animate-in"
}
onClick={() => setShowMore(!showMore)}
>
{showMore ? "Show Less" : "Show More"}
<ChevronUpIcon className={`h-6 w-6 transform duration-300 animate-in ${showMore ? "" : "rotate-180"}`} />
</div>
)}
</Typography>
)
}

0 comments on commit 2ab4d19

Please sign in to comment.