Skip to content

Commit

Permalink
Dont show invitations tab unless there are invitations to show
Browse files Browse the repository at this point in the history
  • Loading branch information
wildjames committed Nov 24, 2024
1 parent a86ea63 commit e92edc0
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions todoqueue_frontend/src/components/households/households.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,23 @@ export const ManageHouseholds = ({ households, updateHouseholds, setShowHousehol
</div>


<div className="invitations-section">
<h3>Pending Invitations</h3>
{invitations.map((invitation) => (
<div key={invitation.id} className="invitation-item">
<span>{invitation.household.name} invited by {invitation.sender.email}</span>
<button className="button complete-button" onClick={() => handleAcceptInvitation(invitation.id)}>
Accept
</button>
<button className="button unfreeze-button" onClick={() => handleDeclineInvitation(invitation.id)}>
Decline
</button>
</div>
))}
</div>
{
(invitations.length > 0) &&
<div className="invitations-section">
<h3>Pending Invitations</h3>
{invitations.map((invitation) => (
<div key={invitation.id} className="invitation-item">
<span>{invitation.household.name} invited by {invitation.sender.email}</span>
<button className="button complete-button" onClick={() => handleAcceptInvitation(invitation.id)}>
Accept
</button>
<button className="button unfreeze-button" onClick={() => handleDeclineInvitation(invitation.id)}>
Decline
</button>
</div>
))}
</div>
}


<div>
Expand Down

0 comments on commit e92edc0

Please sign in to comment.