@xswap-link/sdk 0.8.4 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.global.js +103 -103
- package/dist/index.js +9 -9
- package/dist/index.mjs +10 -10
- package/package.json +1 -1
- package/src/components/Swap/SwapView/ConfirmationView/TxOverview/SwapPanel/index.tsx +5 -1
- package/src/components/Swap/SwapView/ConfirmationView/TxResult/TokenItem/index.tsx +2 -1
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/QuickPickTokenItem/index.tsx +5 -1
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/TokenItem/index.tsx +2 -2
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/index.tsx +2 -1
- package/src/components/Swap/SwapView/SwapPanel/TokenPanel/index.tsx +2 -2
- package/src/components/TokenLogo/Unknown/index.tsx +1 -1
- package/src/components/TokenLogo/index.tsx +17 -2
- package/src/components/TxDataCard/TokenDetails/index.tsx +3 -3
package/package.json
CHANGED
|
@@ -54,7 +54,11 @@ export const SwapPanel = ({ type }: Props) => {
|
|
|
54
54
|
<div>{token?.symbol}</div>
|
|
55
55
|
<div className="opacity-60">{chain?.displayName}</div>
|
|
56
56
|
</div>
|
|
57
|
-
<TokenLogo
|
|
57
|
+
<TokenLogo
|
|
58
|
+
token={token}
|
|
59
|
+
className="w-9 h-9"
|
|
60
|
+
generatedLogoClassName="w-9 h-9"
|
|
61
|
+
/>
|
|
58
62
|
</div>
|
|
59
63
|
</div>
|
|
60
64
|
);
|
|
@@ -13,7 +13,8 @@ export const TokenItem = ({ chain, token, value }: Props) => {
|
|
|
13
13
|
chain={chain}
|
|
14
14
|
token={token}
|
|
15
15
|
chainLogoClassName="w-5"
|
|
16
|
-
tokenLogoClassName="w-
|
|
16
|
+
tokenLogoClassName="w-9 h-9"
|
|
17
|
+
generatedLogoClassName="w-9 h-9 text-[16px]"
|
|
17
18
|
/>
|
|
18
19
|
<div className="flex flex-col w-min sm:w-auto">
|
|
19
20
|
<div>{`${value} ${token?.symbol}`}</div>
|
package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/QuickPickTokenItem/index.tsx
CHANGED
|
@@ -30,7 +30,11 @@ export const QuickPickTokenItem = ({
|
|
|
30
30
|
}`}
|
|
31
31
|
onClick={onClick}
|
|
32
32
|
>
|
|
33
|
-
<TokenLogo
|
|
33
|
+
<TokenLogo
|
|
34
|
+
token={token}
|
|
35
|
+
className="w-6 h-6"
|
|
36
|
+
generatedLogoClassName="w-6 h-6"
|
|
37
|
+
/>
|
|
34
38
|
<div className="flex flex-col gap-1 text-xs font-medium !leading-3">
|
|
35
39
|
<div className="text-t_text_primary">{token.symbol}</div>
|
|
36
40
|
<div className="text-t_text_primary text-opacity-50">
|
|
@@ -31,8 +31,8 @@ export const TokenItem = ({ token, selectedTokenAddress, onClick }: Props) => {
|
|
|
31
31
|
<TokenLogoWithChain
|
|
32
32
|
token={token}
|
|
33
33
|
chain={chain}
|
|
34
|
-
tokenLogoClassName="w-9"
|
|
35
|
-
generatedLogoClassName="w-9
|
|
34
|
+
tokenLogoClassName="min-w-9 w-9 h-9"
|
|
35
|
+
generatedLogoClassName="min-w-9 w-9 h-9 text-[16px]"
|
|
36
36
|
chainLogoClassName="w-5"
|
|
37
37
|
/>
|
|
38
38
|
<div className="flex justify-between items-center gap-1 w-full">
|
|
@@ -350,7 +350,8 @@ export const TokenPicker = ({
|
|
|
350
350
|
<TokenLogoWithChain
|
|
351
351
|
token={customTokenData}
|
|
352
352
|
chain={chain}
|
|
353
|
-
tokenLogoClassName="w-9"
|
|
353
|
+
tokenLogoClassName="w-9 h-9"
|
|
354
|
+
generatedLogoClassName="w-9 h-9 text-[16px]"
|
|
354
355
|
chainLogoClassName="w-5"
|
|
355
356
|
/>
|
|
356
357
|
<div className="flex justify-between items-center gap-1 overflow-hidden grow">
|
|
@@ -107,8 +107,8 @@ export const TokenPanel = ({ chain, token, type, className }: Props) => {
|
|
|
107
107
|
<div className="flex gap-2 items-center">
|
|
108
108
|
<TokenLogo
|
|
109
109
|
token={token}
|
|
110
|
-
className="w-
|
|
111
|
-
generatedLogoClassName=" text-[16px]"
|
|
110
|
+
className="w-9 h-9"
|
|
111
|
+
generatedLogoClassName="w-9 h-9 text-[16px]"
|
|
112
112
|
/>
|
|
113
113
|
<div className="flex flex-col font-medium items-start">
|
|
114
114
|
<p className="text-xs opacity-60">Token: </p>
|
|
@@ -5,7 +5,7 @@ type Props = {
|
|
|
5
5
|
export const UnknownTokenLogo = ({ tokenName, className }: Props) => {
|
|
6
6
|
return (
|
|
7
7
|
<div
|
|
8
|
-
className={`
|
|
8
|
+
className={`rounded-full bg-white shadow-sm flex items-center justify-center text-black ${className}`}
|
|
9
9
|
>
|
|
10
10
|
{tokenName.substring(0, 1)}
|
|
11
11
|
</div>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
1
2
|
import { UnknownTokenLogo } from "./Unknown";
|
|
2
3
|
import { Token } from "@src/models";
|
|
3
4
|
|
|
@@ -11,16 +12,30 @@ export const TokenLogo = ({
|
|
|
11
12
|
className,
|
|
12
13
|
generatedLogoClassName,
|
|
13
14
|
}: Props) => {
|
|
15
|
+
const [errorOcurred, setErrorOccured] = useState(false);
|
|
16
|
+
if (!token) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
if (errorOcurred) {
|
|
20
|
+
return (
|
|
21
|
+
<UnknownTokenLogo
|
|
22
|
+
tokenName={token.name!}
|
|
23
|
+
className={generatedLogoClassName}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
14
28
|
return token?.image ? (
|
|
15
29
|
<img
|
|
16
30
|
src={token.image}
|
|
17
31
|
alt={token.name}
|
|
18
32
|
className={`border border-solid border-t_text_primary border-opacity-10 rounded-2xl ${className}`}
|
|
33
|
+
onError={() => setErrorOccured(true)}
|
|
19
34
|
/>
|
|
20
|
-
) :
|
|
35
|
+
) : (
|
|
21
36
|
<UnknownTokenLogo
|
|
22
37
|
tokenName={token.name!}
|
|
23
38
|
className={generatedLogoClassName}
|
|
24
39
|
/>
|
|
25
|
-
)
|
|
40
|
+
);
|
|
26
41
|
};
|
|
@@ -13,9 +13,9 @@ export const TokenDetails = ({ chain, token, amount }: Props) => {
|
|
|
13
13
|
<TokenLogoWithChain
|
|
14
14
|
token={token}
|
|
15
15
|
chain={chain}
|
|
16
|
-
tokenLogoClassName="min-w-9 w-9"
|
|
17
|
-
generatedLogoClassName="min-w-9 w-9 text-[16px]"
|
|
18
|
-
chainLogoClassName="
|
|
16
|
+
tokenLogoClassName="min-w-9 w-9 h-9"
|
|
17
|
+
generatedLogoClassName="min-w-9 w-9 h-9 text-[16px]"
|
|
18
|
+
chainLogoClassName="w-5"
|
|
19
19
|
/>
|
|
20
20
|
<div className="flex flex-col text-[12px]">
|
|
21
21
|
<div className="text-t_text_primary text-nowrap">
|