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

Commit ad0c9d9

Browse files
authored
Merge pull request #33 from oxygenpay/develop
fixed issue with some empty fields from server (#32)
2 parents 2761fee + 521d031 commit ad0c9d9

File tree

2 files changed

+34
-27
lines changed

2 files changed

+34
-27
lines changed

ui-dashboard/src/components/withdraw-desc-card/withdraw-desc-card.tsx

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,23 @@ const WithdrawalDescCard: React.FC<Props> = ({data, openNotificationFunc, addres
105105
</Descriptions.Item>
106106

107107
<Descriptions.Item span={3} label={<span className={b("item-title")}>Transaction ID</span>}>
108-
{renderStrippedStr(data.additionalInfo.withdrawal.transactionHash, 24, -12)}{" "}
109-
<CopyOutlined
110-
className={b("copy-btn")}
111-
onClick={() =>
112-
copyToClipboard(
113-
data?.additionalInfo?.withdrawal?.transactionHash
114-
? data.additionalInfo.withdrawal.transactionHash
115-
: "",
116-
openNotificationFunc
117-
)
118-
}
119-
/>
108+
{data.additionalInfo.withdrawal.transactionHash != null
109+
? renderStrippedStr(data.additionalInfo.withdrawal.transactionHash, 24, -12)
110+
: "Transaction hash is not created yet"}
111+
{data.additionalInfo.withdrawal.transactionHash != null ? " " : null}
112+
{data.additionalInfo.withdrawal.transactionHash != null ? (
113+
<CopyOutlined
114+
className={b("copy-btn")}
115+
onClick={() =>
116+
copyToClipboard(
117+
data?.additionalInfo?.withdrawal?.transactionHash
118+
? data.additionalInfo.withdrawal.transactionHash
119+
: "",
120+
openNotificationFunc
121+
)
122+
}
123+
/>
124+
) : null}
120125
</Descriptions.Item>
121126
{data.additionalInfo?.payment?.customerEmail ? (
122127
<>
@@ -135,15 +140,17 @@ const WithdrawalDescCard: React.FC<Props> = ({data, openNotificationFunc, addres
135140
</Descriptions.Item>
136141
</>
137142
) : null}
138-
<Descriptions.Item>
139-
<a
140-
href={data.additionalInfo.withdrawal.explorerLink}
141-
target="_blank"
142-
rel="noopener noreferrer"
143-
>
144-
View on blockchain explorer <LinkOutlined className={b("copy-btn")} />
145-
</a>
146-
</Descriptions.Item>
143+
{data.additionalInfo.withdrawal.explorerLink != null ? (
144+
<Descriptions.Item>
145+
<a
146+
href={data.additionalInfo.withdrawal.explorerLink ?? ""}
147+
target="_blank"
148+
rel="noopener noreferrer"
149+
>
150+
View on blockchain explorer <LinkOutlined className={b("copy-btn")} />
151+
</a>
152+
</Descriptions.Item>
153+
) : null}
147154
</Descriptions>
148155
</>
149156
)}

ui-dashboard/src/types/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ interface AdditionalPaymentInfo {
137137
interface AdditionalWithdrawalInfo {
138138
addressId: string;
139139
balanceId: string;
140-
explorerLink: string;
140+
explorerLink: string | null;
141141
serviceFee: string;
142-
transactionHash: string;
142+
transactionHash: string | null;
143143
}
144144

145145
interface AdditionalInfo {
@@ -150,15 +150,15 @@ interface AdditionalInfo {
150150
interface Payment {
151151
additionalInfo?: AdditionalInfo;
152152
id: string;
153-
orderId: string;
153+
orderId?: string;
154154
type: PaymentType;
155155
status: PaymentStatus;
156156
createdAt: string;
157157
currency: CurrencyWithFiat;
158158
price: string;
159-
redirectUrl: string;
160-
paymentUrl: string;
161-
description: string;
159+
redirectUrl?: string;
160+
paymentUrl?: string;
161+
description?: string;
162162
isTest: boolean;
163163
}
164164

0 commit comments

Comments
 (0)