Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

fixed issue with some empty fields from server (#32) #33

Merged
merged 2 commits into from
Sep 5, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,23 @@ const WithdrawalDescCard: React.FC<Props> = ({data, openNotificationFunc, addres
</Descriptions.Item>

<Descriptions.Item span={3} label={<span className={b("item-title")}>Transaction ID</span>}>
{renderStrippedStr(data.additionalInfo.withdrawal.transactionHash, 24, -12)}{" "}
<CopyOutlined
className={b("copy-btn")}
onClick={() =>
copyToClipboard(
data?.additionalInfo?.withdrawal?.transactionHash
? data.additionalInfo.withdrawal.transactionHash
: "",
openNotificationFunc
)
}
/>
{data.additionalInfo.withdrawal.transactionHash != null
? renderStrippedStr(data.additionalInfo.withdrawal.transactionHash, 24, -12)
: "Transaction hash is not created yet"}
{data.additionalInfo.withdrawal.transactionHash != null ? " " : null}
{data.additionalInfo.withdrawal.transactionHash != null ? (
<CopyOutlined
className={b("copy-btn")}
onClick={() =>
copyToClipboard(
data?.additionalInfo?.withdrawal?.transactionHash
? data.additionalInfo.withdrawal.transactionHash
: "",
openNotificationFunc
)
}
/>
) : null}
</Descriptions.Item>
{data.additionalInfo?.payment?.customerEmail ? (
<>
Expand All @@ -135,15 +140,17 @@ const WithdrawalDescCard: React.FC<Props> = ({data, openNotificationFunc, addres
</Descriptions.Item>
</>
) : null}
<Descriptions.Item>
<a
href={data.additionalInfo.withdrawal.explorerLink}
target="_blank"
rel="noopener noreferrer"
>
View on blockchain explorer <LinkOutlined className={b("copy-btn")} />
</a>
</Descriptions.Item>
{data.additionalInfo.withdrawal.explorerLink != null ? (
<Descriptions.Item>
<a
href={data.additionalInfo.withdrawal.explorerLink ?? ""}
target="_blank"
rel="noopener noreferrer"
>
View on blockchain explorer <LinkOutlined className={b("copy-btn")} />
</a>
</Descriptions.Item>
) : null}
</Descriptions>
</>
)}
Expand Down
12 changes: 6 additions & 6 deletions ui-dashboard/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ interface AdditionalPaymentInfo {
interface AdditionalWithdrawalInfo {
addressId: string;
balanceId: string;
explorerLink: string;
explorerLink: string | null;
serviceFee: string;
transactionHash: string;
transactionHash: string | null;
}

interface AdditionalInfo {
Expand All @@ -150,15 +150,15 @@ interface AdditionalInfo {
interface Payment {
additionalInfo?: AdditionalInfo;
id: string;
orderId: string;
orderId?: string;
type: PaymentType;
status: PaymentStatus;
createdAt: string;
currency: CurrencyWithFiat;
price: string;
redirectUrl: string;
paymentUrl: string;
description: string;
redirectUrl?: string;
paymentUrl?: string;
description?: string;
isTest: boolean;
}

Expand Down