Skip to content

Commit

Permalink
hide button while there is no record to show in the table
Browse files Browse the repository at this point in the history
  • Loading branch information
zuies committed Jun 28, 2023
1 parent f7a9c54 commit 15e2721
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function ActiveMemberBreakdown() {

return (
<>
<div className="relative overflow-x-scroll md:overflow-hidden">
<div className="relative overflow-x-scroll md:overflow-hidden mb-8">
<h3 className="text-xl font-medium text-lite-black md:mb-4">
Members breakdown
</h3>
Expand Down Expand Up @@ -124,15 +124,17 @@ export default function ActiveMemberBreakdown() {
</div>
</div>
</div>
<div className="flex justify-center mt-2 mb-12">
<CustomButton
label={isExpanded ? 'Show less' : 'Show member breakdown'}
classes={'text-black'}
variant="outlined"
disabled={fetchedData?.totalResults === 0}
onClick={() => toggleExpanded(!isExpanded)}
/>
</div>
{fetchedData?.results.length > 0 ?? (
<div className="flex justify-center mt-2 mb-12">
<CustomButton
label={isExpanded ? 'Show less' : 'Show member breakdown'}
classes={'text-black'}
variant="outlined"
disabled={fetchedData?.totalResults === 0}
onClick={() => toggleExpanded(!isExpanded)}
/>
</div>
)}
</>
);
}

0 comments on commit 15e2721

Please sign in to comment.