);
}
// If the escrow is Locked, show the collaborative cancel button.
if ([8, 9].includes(this.state.status)) {
return (
{this.CollaborativeCancelDialog()}
);
}
// If none of the above do not return a cancel button.
return null;
};
// Colors for the status badges
statusBadgeColor(status) {
if (status == 'Active') {
return 'success';
}
if (status == 'Seen recently') {
return 'warning';
}
if (status == 'Inactive') {
return 'error';
}
}
orderBox = () => {
const { t } = this.props;
return (
{t('Order Box')}
{' '}
{!this.state.type ? (
) : (
)}
}
>
{this.state.is_participant ? (
<>
{this.state.taker_nick != 'None' ? (
<>
{' '}
{this.state.type ? (
) : (
)}
}
>
>
) : (
''
)}
>
) : (
)}
{this.state.has_range & (this.state.amount == null) ? (
) : (
)}
}
secondary={
this.state.currency == 1000
? t('Swap destination')
: t('Accepted payment methods')
}
/>
{/* If there is live Price and Premium data, show it. Otherwise show the order maker settings */}
{this.state.price_now ? (
) : this.state.is_explicit ? (
) : (
)}
{/* if order is in a status that does not expire, do not show countdown */}
{[4, 12, 13, 14, 15, 16, 17, 18].includes(this.state.status) ? null : (
<>
>
)}
{/* If the user has a penalty/limit */}
{this.state.penalty ? (
<>
>
) : null}
{/* If the counterparty asked for collaborative cancel */}
{this.state.pending_cancel ? (
<>
{t('{{nickname}} is asking for a collaborative cancel', {
nickname: this.state.is_maker ? this.state.taker_nick : this.state.maker_nick,
})}
>
) : null}
{/* If the user has asked for a collaborative cancel */}
{this.state.asked_for_cancel ? (
<>
{t('You asked for a collaborative cancellation')}
>
) : null}
{/* Participants can see the "Cancel" Button, but cannot see the "Back" or "Take Order" buttons */}
{this.state.is_participant ? (
<>
{this.CancelButton()}
{this.BackButton()}
>
) : (
)}
);
};
doubleOrderPageDesktop = () => {
return (
{this.orderBox()}
);
};
a11yProps(index) {
return {
id: `simple-tab-${index}`,
'aria-controls': `simple-tabpanel-${index}`,
};
}
doubleOrderPagePhone = () => {
const { t } = this.props;
return (
this.setState({ tabValue: 0 })}
/>
this.setState({ tabValue: 1 })}
/>