Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pending tag color, update alert condition display #697

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions clients/banking/src/components/TransactionDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,22 @@ export const TransactionDetail = ({
style={styles.tile}
footer={match(transaction)
// BankingFee should never happen, so we don't handle it
.with({ feesType: P.not("BankingFee") }, ({ feesType }) => {
const description = getFeesDescription(feesType);
// We display the description only for non rejected transaction because it has already an alert displayed in this case
.with(
{
feesType: P.not("BankingFee"),
statusInfo: { __typename: P.not("RejectedTransactionStatusInfo") },
},
({ feesType }) => {
const description = getFeesDescription(feesType);

if (isNullish(description)) {
return null;
}
if (isNullish(description)) {
return null;
}

return <LakeAlert anchored={true} variant="info" title={description} />;
})
return <LakeAlert anchored={true} variant="info" title={description} />;
},
)
.with(
{
statusInfo: { status: "Pending" },
Expand All @@ -174,8 +181,6 @@ export const TransactionDetail = ({
)
.with(
{
// We display the reason of a rejected transaction which isn't a fee because it has already an alert displayed
__typename: P.not("FeeTransaction"),
statusInfo: { __typename: "RejectedTransactionStatusInfo", reason: P.select() },
},
reason => {
Expand All @@ -196,7 +201,7 @@ export const TransactionDetail = ({
pendingEndDate => (
<LakeAlert
anchored={true}
variant="warning"
variant="info"
title={t("transaction.pendingTransaction.description", {
executionDate: formatDateTime(new Date(pendingEndDate), "LL"),
})}
Expand All @@ -207,7 +212,7 @@ export const TransactionDetail = ({
>
{match(transaction.statusInfo.__typename)
.with("PendingTransactionStatusInfo", () => (
<Tag color="warning">{t("transactionStatus.pending")}</Tag>
<Tag color="shakespear">{t("transactionStatus.pending")}</Tag>
))
.with("RejectedTransactionStatusInfo", () => (
<Tag color="negative">{t("transactionStatus.rejected")}</Tag>
Expand Down
4 changes: 2 additions & 2 deletions clients/banking/src/components/TransactionListCells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const TransactionNameCell = ({ transaction }: { transaction: Transaction
.with("PendingTransactionStatusInfo", () => (
<>
<Space width={16} />
<Tag color="warning">{t("transactionStatus.pending")}</Tag>
<Tag color="shakespear">{t("transactionStatus.pending")}</Tag>
</>
))
.with("RejectedTransactionStatusInfo", () => (
Expand Down Expand Up @@ -294,7 +294,7 @@ export const TransactionSummaryCell = ({ transaction }: { transaction: Transacti
.with("PendingTransactionStatusInfo", () => (
<>
<Space width={12} />
<Tag color="warning">{t("transactionStatus.pending")}</Tag>
<Tag color="shakespear">{t("transactionStatus.pending")}</Tag>
</>
))
.with("RejectedTransactionStatusInfo", () => (
Expand Down
Loading