fix: edge case with suspensions shorter than 1 day

This commit is contained in:
Sérgio Salgado 2021-07-19 19:25:59 +01:00 committed by Josh Harvey
parent c0218e672f
commit fe665f1e9c
5 changed files with 15 additions and 10 deletions

View file

@ -56,6 +56,7 @@ const GET_CUSTOMER = gql`
lastTxFiatCode
lastTxClass
daysSuspended
isSuspended
transactions {
txClass
id
@ -136,7 +137,7 @@ const CustomerProfile = memo(() => {
const blocked =
R.path(['authorizedOverride'])(customerData) === OVERRIDE_REJECTED
const suspended = R.gt(R.path(['daysSuspended'])(customerData), 0)
const isSuspended = customerData.isSuspended
return (
<>
@ -173,13 +174,11 @@ const CustomerProfile = memo(() => {
<div>
<Label1 className={classes.actionLabel}>Actions</Label1>
<div className={classes.customerActions}>
{suspended && (
{isSuspended && (
<ActionButton
color="primary"
Icon={suspended ? AuthorizeIcon : BlockIcon}
InverseIcon={
suspended ? AuthorizeReversedIcon : BlockReversedIcon
}
Icon={AuthorizeIcon}
InverseIcon={AuthorizeReversedIcon}
onClick={() =>
updateCustomer({
suspendedUntil: null