Skip to content

Commit

Permalink
fix: fix button logic in trusts side panel
Browse files Browse the repository at this point in the history
  • Loading branch information
samwel141 committed Aug 27, 2024
1 parent 4bbebf9 commit ea0f717
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions src/pages/TrustRelationship/trustRelationshipSidePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,16 @@ function TrustRelationshipSidePanel({ open, onClose, rowInfo }) {
</TallTypography>
</Grid>
</Grid>
{rowInfo.state === 'requested' && wallet.name === rowInfo.target_wallet && (
<Grid sx={3} style={{ margin: '5rem 4rem' }}>
<AcceptButton
variant="contained"
color="primary"
onClick={() => handleAccept(rowInfo.id)}
>
Accept
</AcceptButton>
<DeclineButton onClick={() => handleDecline(rowInfo.id)}>
Decline
</DeclineButton>
</Grid>
)}
{rowInfo.state === 'trusted' && (
<Grid sx={3} style={{ margin: '5rem 7.2rem', backgroundColor: 'red', borderRadius: 8, padding: '10px' }}>
<DeleteButton onClick={() => handleDelete(rowInfo.id)}>
Delete
</DeleteButton>
</Grid>
)}

{rowInfo.state === 'requested' && managedWalletsWithDefault.wallets.some(wallet => wallet.name === rowInfo.target_wallet) && (
{rowInfo.state === 'requested' && (
managedWalletsWithDefault.wallets.some(wallet => wallet.name === rowInfo.target_wallet) || wallet.name === rowInfo.target_wallet ? (
<Grid sx={3} style={{ margin: '5rem 4rem' }}>
<AcceptButton
variant="contained"
Expand All @@ -158,15 +152,17 @@ function TrustRelationshipSidePanel({ open, onClose, rowInfo }) {
Decline
</DeclineButton>
</Grid>
)}

{rowInfo.state === 'trusted' && (
) : (
<Grid sx={3} style={{ margin: '5rem 7.2rem', backgroundColor: 'red', borderRadius: 8, padding: '10px' }}>
<DeleteButton onClick={() => handleDelete(rowInfo.id)}>
Delete
</DeleteButton>
</Grid>
)}
)
)}

{(rowInfo.state === 'cancelled_by_target' || rowInfo.state === 'cancelled_by_originator') && null}

</div>
</DrawerStyled>
);
Expand Down

0 comments on commit ea0f717

Please sign in to comment.