Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
b7f8e650
Commit
b7f8e650
authored
Jan 30, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token symbol fixes
parent
e9537340
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
136 additions
and
28 deletions
+136
-28
trimTokenSymbol.ts
lib/token/trimTokenSymbol.ts
+13
-0
tokenBalance.ts
mocks/address/tokenBalance.ts
+24
-0
tokenInfo.ts
mocks/tokens/tokenInfo.ts
+22
-0
tokenTransfer.ts
mocks/tokens/tokenTransfer.ts
+4
-3
AddressNameInfo.tsx
ui/address/details/AddressNameInfo.tsx
+3
-1
TokenSelect.pw.tsx
ui/address/tokenSelect/TokenSelect.pw.tsx
+31
-0
TokenSelectItem.tsx
ui/address/tokenSelect/TokenSelectItem.tsx
+12
-7
TokenSelect.pw.tsx_default_long-values-1.png
...creenshots__/TokenSelect.pw.tsx_default_long-values-1.png
+0
-0
Token.tsx
ui/pages/Token.tsx
+6
-2
SearchResultListItem.tsx
ui/searchResults/SearchResultListItem.tsx
+2
-1
SearchResultTableItem.tsx
ui/searchResults/SearchResultTableItem.tsx
+2
-1
TokenDetails.tsx
ui/token/TokenDetails.tsx
+9
-9
NftTokenTransferSnippet.tsx
ui/tx/NftTokenTransferSnippet.tsx
+4
-1
TxDetails.pw.tsx_default_with-token-transfer-mobile-1.png
...TxDetails.pw.tsx_default_with-token-transfer-mobile-1.png
+0
-0
TxDetails.pw.tsx_mobile_with-token-transfer-mobile-1.png
.../TxDetails.pw.tsx_mobile_with-token-transfer-mobile-1.png
+0
-0
TxDetailsTokenTransfer.tsx
ui/tx/details/TxDetailsTokenTransfer.tsx
+4
-3
No files found.
lib/token/trimTokenSymbol.ts
0 → 100644
View file @
b7f8e650
// some tokens could have symbols like "ipfs://QmUpFUfVKDCWeZQk5pvDFUxnpQP9N6eLSHhNUy49T1JVtY"
// so in some cases we trim it to max 10 symbols
export
default
function
trimTokenSymbol
(
symbol
:
string
|
null
)
{
if
(
!
symbol
)
{
return
''
;
}
if
(
symbol
.
length
<=
7
)
{
return
symbol
;
}
return
symbol
.
slice
(
0
,
7
)
+
'
...
'
;
}
mocks/address/tokenBalance.ts
View file @
b7f8e650
...
@@ -26,6 +26,12 @@ export const erc20d: AddressTokenBalance = {
...
@@ -26,6 +26,12 @@ export const erc20d: AddressTokenBalance = {
value
:
'
39000000000000000000
'
,
value
:
'
39000000000000000000
'
,
};
};
export
const
erc20LongSymbol
:
AddressTokenBalance
=
{
token
:
tokens
.
tokenInfoERC20LongSymbol
,
token_id
:
null
,
value
:
'
39000000000000000000
'
,
};
export
const
erc721a
:
AddressTokenBalance
=
{
export
const
erc721a
:
AddressTokenBalance
=
{
token
:
tokens
.
tokenInfoERC721a
,
token
:
tokens
.
tokenInfoERC721a
,
token_id
:
null
,
token_id
:
null
,
...
@@ -44,6 +50,12 @@ export const erc721c: AddressTokenBalance = {
...
@@ -44,6 +50,12 @@ export const erc721c: AddressTokenBalance = {
value
:
'
5
'
,
value
:
'
5
'
,
};
};
export
const
erc721LongSymbol
:
AddressTokenBalance
=
{
token
:
tokens
.
tokenInfoERC721LongSymbol
,
token_id
:
null
,
value
:
'
5
'
,
};
export
const
erc1155a
:
AddressTokenBalance
=
{
export
const
erc1155a
:
AddressTokenBalance
=
{
token
:
tokens
.
tokenInfoERC1155a
,
token
:
tokens
.
tokenInfoERC1155a
,
token_id
:
'
42
'
,
token_id
:
'
42
'
,
...
@@ -62,6 +74,12 @@ export const erc1155withoutName: AddressTokenBalance = {
...
@@ -62,6 +74,12 @@ export const erc1155withoutName: AddressTokenBalance = {
value
:
'
42
'
,
value
:
'
42
'
,
};
};
export
const
erc1155LongId
:
AddressTokenBalance
=
{
token
:
tokens
.
tokenInfoERC1155b
,
token_id
:
'
483200961027732618117991942553110860267520
'
,
value
:
'
42
'
,
};
export
const
baseList
=
[
export
const
baseList
=
[
erc20a
,
erc20a
,
erc20b
,
erc20b
,
...
@@ -73,3 +91,9 @@ export const baseList = [
...
@@ -73,3 +91,9 @@ export const baseList = [
erc1155a
,
erc1155a
,
erc1155b
,
erc1155b
,
];
];
export
const
longValuesList
=
[
erc20LongSymbol
,
erc721LongSymbol
,
erc1155LongId
,
];
mocks/tokens/tokenInfo.ts
View file @
b7f8e650
...
@@ -60,6 +60,17 @@ export const tokenInfoERC20d: TokenInfo = {
...
@@ -60,6 +60,17 @@ export const tokenInfoERC20d: TokenInfo = {
type
:
'
ERC-20
'
,
type
:
'
ERC-20
'
,
};
};
export
const
tokenInfoERC20LongSymbol
:
TokenInfo
=
{
address
:
'
0xCc7bb2D219A0FC08033E130629C2B854b7bA9195
'
,
decimals
:
'
18
'
,
exchange_rate
:
'
1328.89
'
,
holders
:
'
102625
'
,
name
:
'
Zeta
'
,
symbol
:
'
ipfs://QmUpFUfVKDCWeZQk5pvDFUxnpQP9N6eLSHhNUy49T1JVtY
'
,
total_supply
:
'
2100000000000000000000000000
'
,
type
:
'
ERC-20
'
,
};
export
const
tokenInfoERC721a
:
TokenInfo
=
{
export
const
tokenInfoERC721a
:
TokenInfo
=
{
address
:
'
0xDe7cAc71E072FCBd4453E5FB3558C2684d1F88A0
'
,
address
:
'
0xDe7cAc71E072FCBd4453E5FB3558C2684d1F88A0
'
,
decimals
:
null
,
decimals
:
null
,
...
@@ -93,6 +104,17 @@ export const tokenInfoERC721c: TokenInfo = {
...
@@ -93,6 +104,17 @@ export const tokenInfoERC721c: TokenInfo = {
type
:
'
ERC-721
'
,
type
:
'
ERC-721
'
,
};
};
export
const
tokenInfoERC721LongSymbol
:
TokenInfo
=
{
address
:
'
0x47646F1d7dc4Dd2Db5a41D092e2Cf966e27A4992
'
,
decimals
:
null
,
exchange_rate
:
null
,
holders
:
'
12
'
,
name
:
'
Puma
'
,
symbol
:
'
ipfs://QmUpFUfVKDCWeZQk5pvDFUxnpQP9N6eLSHhNUy49T1JVtY
'
,
total_supply
:
null
,
type
:
'
ERC-721
'
,
};
export
const
tokenInfoERC1155a
:
TokenInfo
=
{
export
const
tokenInfoERC1155a
:
TokenInfo
=
{
address
:
'
0x4b333DEd10c7ca855EA2C8D4D90A0a8b73788c8e
'
,
address
:
'
0x4b333DEd10c7ca855EA2C8D4D90A0a8b73788c8e
'
,
decimals
:
null
,
decimals
:
null
,
...
...
mocks/tokens/tokenTransfer.ts
View file @
b7f8e650
...
@@ -132,12 +132,13 @@ export const erc1155multiple: TokenTransfer = {
...
@@ -132,12 +132,13 @@ export const erc1155multiple: TokenTransfer = {
...
erc1155
,
...
erc1155
,
token
:
{
token
:
{
...
erc1155
.
token
,
...
erc1155
.
token
,
name
:
'
OLYMPIC
'
,
name
:
'
SastanaNFT
'
,
symbol
:
'
ipfs://QmUpFUfVKDCWeZQk5pvDFUxnpQP9N6eLSHhNUy49T1JVtY
'
,
},
},
total
:
[
total
:
[
{
token_id
:
'
12345678
'
,
value
:
'
100000000000000000000
'
,
decimals
:
null
},
{
token_id
:
'
483200961027732618117991942553110860267520
'
,
value
:
'
200000000000000000000
'
,
decimals
:
null
},
{
token_id
:
'
456
'
,
value
:
'
42
'
,
decimals
:
null
},
{
token_id
:
'
456
'
,
value
:
'
42
'
,
decimals
:
null
},
{
token_id
:
'
12345678
'
,
value
:
'
142
'
,
decimals
:
null
},
{
token_id
:
'
1000006457499
'
,
value
:
'
11
'
,
decimals
:
null
},
],
],
};
};
...
...
ui/address/details/AddressNameInfo.tsx
View file @
b7f8e650
...
@@ -3,6 +3,7 @@ import React from 'react';
...
@@ -3,6 +3,7 @@ import React from 'react';
import
type
{
Address
}
from
'
types/api/address
'
;
import
type
{
Address
}
from
'
types/api/address
'
;
import
link
from
'
lib/link/link
'
;
import
link
from
'
lib/link/link
'
;
import
trimTokenSymbol
from
'
lib/token/trimTokenSymbol
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
...
@@ -12,13 +13,14 @@ interface Props {
...
@@ -12,13 +13,14 @@ interface Props {
const
AddressNameInfo
=
({
data
}:
Props
)
=>
{
const
AddressNameInfo
=
({
data
}:
Props
)
=>
{
if
(
data
.
token
)
{
if
(
data
.
token
)
{
const
symbol
=
data
.
token
.
symbol
?
` (
${
trimTokenSymbol
(
data
.
token
.
symbol
)
}
)`
:
''
;
return
(
return
(
<
DetailsInfoItem
<
DetailsInfoItem
title=
"Token name"
title=
"Token name"
hint=
"Token name and symbol"
hint=
"Token name and symbol"
>
>
<
LinkInternal
href=
{
link
(
'
token_index
'
,
{
hash
:
data
.
token
.
address
})
}
>
<
LinkInternal
href=
{
link
(
'
token_index
'
,
{
hash
:
data
.
token
.
address
})
}
>
{
data
.
token
.
name
}
(
{
data
.
token
.
symbol
}
)
{
data
.
token
.
name
}
{
symbol
}
</
LinkInternal
>
</
LinkInternal
>
</
DetailsInfoItem
>
</
DetailsInfoItem
>
);
);
...
...
ui/address/tokenSelect/TokenSelect.pw.tsx
View file @
b7f8e650
...
@@ -126,6 +126,37 @@ test('filter', async({ mount, page }) => {
...
@@ -126,6 +126,37 @@ test('filter', async({ mount, page }) => {
await
expect
(
page
).
toHaveScreenshot
({
clip
:
CLIPPING_AREA
});
await
expect
(
page
).
toHaveScreenshot
({
clip
:
CLIPPING_AREA
});
});
});
base
(
'
long values
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
ASSET_URL
,
(
route
)
=>
{
return
route
.
fulfill
({
status
:
200
,
path
:
'
./playwright/image_s.jpg
'
,
});
});
await
page
.
route
(
ADDRESS_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
({
hash
:
'
1
'
}),
}),
{
times
:
1
});
await
page
.
route
(
TOKENS_API_URL
,
async
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
tokenBalanceMock
.
longValuesList
),
}),
{
times
:
1
});
await
mount
(
<
TestApp
>
<
MockAddressPage
>
<
Flex
>
<
TokenSelect
/>
</
Flex
>
</
MockAddressPage
>
</
TestApp
>,
{
hooksConfig
},
);
await
page
.
getByRole
(
'
button
'
,
{
name
:
/select/i
}).
click
();
await
expect
(
page
).
toHaveScreenshot
({
clip
:
CLIPPING_AREA
});
});
test
.
describe
(
'
socket
'
,
()
=>
{
test
.
describe
(
'
socket
'
,
()
=>
{
const
testWithSocket
=
test
.
extend
<
socketServer
.
SocketServerFixture
>
({
const
testWithSocket
=
test
.
extend
<
socketServer
.
SocketServerFixture
>
({
createSocket
:
socketServer
.
createSocket
,
createSocket
:
socketServer
.
createSocket
,
...
...
ui/address/tokenSelect/TokenSelectItem.tsx
View file @
b7f8e650
import
{
Flex
,
Text
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
chakra
,
Flex
,
Text
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
link
from
'
lib/link/link
'
;
import
link
from
'
lib/link/link
'
;
import
trimTokenSymbol
from
'
lib/token/trimTokenSymbol
'
;
import
HashStringShorten
from
'
ui/shared/HashStringShorten
'
;
import
HashStringShorten
from
'
ui/shared/HashStringShorten
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
...
@@ -20,19 +21,23 @@ const TokenSelectItem = ({ data }: Props) => {
...
@@ -20,19 +21,23 @@ const TokenSelectItem = ({ data }: Props) => {
const
tokenDecimals
=
Number
(
data
.
token
.
decimals
)
||
18
;
const
tokenDecimals
=
Number
(
data
.
token
.
decimals
)
||
18
;
return
(
return
(
<>
<>
<
Text
>
{
BigNumber
(
data
.
value
).
dividedBy
(
10
**
tokenDecimals
).
toFormat
(
2
)
}
{
data
.
token
.
symbol
}
</
Text
>
<
span
>
{
BigNumber
(
data
.
value
).
dividedBy
(
10
**
tokenDecimals
).
toFormat
(
2
)
}
{
trimTokenSymbol
(
data
.
token
.
symbol
)
}
</
span
>
{
data
.
token
.
exchange_rate
&&
<
Text
>
@
{
data
.
token
.
exchange_rate
}
</
Text
>
}
{
data
.
token
.
exchange_rate
&&
<
span
>
@
{
data
.
token
.
exchange_rate
}
</
span
>
}
</>
</>
);
);
}
}
case
'
ERC-721
'
:
{
case
'
ERC-721
'
:
{
return
<
Text
>
{
BigNumber
(
data
.
value
).
toFormat
()
}
{
data
.
token
.
symbol
}
</
Text
>;
return
<
chakra
.
span
textOverflow=
"ellipsis"
overflow=
"hidden"
>
{
BigNumber
(
data
.
value
).
toFormat
()
}
{
data
.
token
.
symbol
}
</
chakra
.
span
>;
}
}
case
'
ERC-1155
'
:
{
case
'
ERC-1155
'
:
{
return
(
return
(
<>
<>
<
Text
>
#
{
data
.
token_id
||
0
}
</
Text
>
<
chakra
.
span
textOverflow=
"ellipsis"
overflow=
"hidden"
mr=
{
6
}
>
<
Text
>
{
BigNumber
(
data
.
value
).
toFormat
()
}
</
Text
>
#
{
data
.
token_id
||
0
}
</
chakra
.
span
>
<
span
>
{
BigNumber
(
data
.
value
).
toFormat
()
}
</
span
>
</>
</>
);
);
}
}
...
@@ -64,7 +69,7 @@ const TokenSelectItem = ({ data }: Props) => {
...
@@ -64,7 +69,7 @@ const TokenSelectItem = ({ data }: Props) => {
<
Text
fontWeight=
{
700
}
ml=
{
2
}
>
{
data
.
token
.
name
||
<
HashStringShorten
hash=
{
data
.
token
.
address
}
/>
}
</
Text
>
<
Text
fontWeight=
{
700
}
ml=
{
2
}
>
{
data
.
token
.
name
||
<
HashStringShorten
hash=
{
data
.
token
.
address
}
/>
}
</
Text
>
{
data
.
usd
&&
<
Text
fontWeight=
{
700
}
ml=
"auto"
>
$
{
data
.
usd
.
toFormat
(
2
)
}
</
Text
>
}
{
data
.
usd
&&
<
Text
fontWeight=
{
700
}
ml=
"auto"
>
$
{
data
.
usd
.
toFormat
(
2
)
}
</
Text
>
}
</
Flex
>
</
Flex
>
<
Flex
alignItems=
"center"
justifyContent=
"space-between"
w=
"100%"
>
<
Flex
alignItems=
"center"
justifyContent=
"space-between"
w=
"100%"
whiteSpace=
"nowrap"
>
{
secondRow
}
{
secondRow
}
</
Flex
>
</
Flex
>
</
Flex
>
</
Flex
>
...
...
ui/address/tokenSelect/__screenshots__/TokenSelect.pw.tsx_default_long-values-1.png
0 → 100644
View file @
b7f8e650
34.5 KB
ui/pages/Token.tsx
View file @
b7f8e650
...
@@ -8,6 +8,7 @@ import useApiQuery from 'lib/api/useApiQuery';
...
@@ -8,6 +8,7 @@ import useApiQuery from 'lib/api/useApiQuery';
import
{
useAppContext
}
from
'
lib/appContext
'
;
import
{
useAppContext
}
from
'
lib/appContext
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useQueryWithPages
from
'
lib/hooks/useQueryWithPages
'
;
import
useQueryWithPages
from
'
lib/hooks/useQueryWithPages
'
;
import
trimTokenSymbol
from
'
lib/token/trimTokenSymbol
'
;
import
AdBanner
from
'
ui/shared/ad/AdBanner
'
;
import
AdBanner
from
'
ui/shared/ad/AdBanner
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
...
@@ -40,7 +41,8 @@ const TokenPageContent = () => {
...
@@ -40,7 +41,8 @@ const TokenPageContent = () => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
tokenQuery
.
data
)
{
if
(
tokenQuery
.
data
)
{
const
tokenName
=
`
${
tokenQuery
.
data
.
name
}
(
${
tokenQuery
.
data
.
symbol
}
)`
;
const
tokenSymbol
=
tokenQuery
.
data
.
symbol
?
` (
${
tokenQuery
.
data
.
symbol
}
)`
:
''
;
const
tokenName
=
`
${
tokenQuery
.
data
.
name
||
'
Unnamed
'
}${
tokenSymbol
}
`
;
const
title
=
document
.
getElementsByTagName
(
'
title
'
)[
0
];
const
title
=
document
.
getElementsByTagName
(
'
title
'
)[
0
];
if
(
title
)
{
if
(
title
)
{
title
.
textContent
=
title
.
textContent
?.
replace
(
tokenQuery
.
data
.
address
,
tokenName
)
||
title
.
textContent
;
title
.
textContent
=
title
.
textContent
?.
replace
(
tokenQuery
.
data
.
address
,
tokenName
)
||
title
.
textContent
;
...
@@ -88,6 +90,8 @@ const TokenPageContent = () => {
...
@@ -88,6 +90,8 @@ const TokenPageContent = () => {
pagination
=
holdersQuery
.
pagination
;
pagination
=
holdersQuery
.
pagination
;
}
}
const
tokenSymbolText
=
tokenQuery
.
data
?.
symbol
?
` (
${
trimTokenSymbol
(
tokenQuery
.
data
.
symbol
)
}
)`
:
''
;
return
(
return
(
<
Page
>
<
Page
>
{
tokenQuery
.
isLoading
?
(
{
tokenQuery
.
isLoading
?
(
...
@@ -99,7 +103,7 @@ const TokenPageContent = () => {
...
@@ -99,7 +103,7 @@ const TokenPageContent = () => {
<>
<>
<
TextAd
mb=
{
6
}
/>
<
TextAd
mb=
{
6
}
/>
<
PageTitle
<
PageTitle
text=
{
`${ tokenQuery.data?.name
} (${ tokenQuery.data?.symbol })
token`
}
text=
{
`${ tokenQuery.data?.name
|| 'Unnamed' }${ tokenSymbolText }
token`
}
backLinkUrl=
{
hasGoBackLink
?
appProps
.
referrer
:
undefined
}
backLinkUrl=
{
hasGoBackLink
?
appProps
.
referrer
:
undefined
}
backLinkLabel=
"Back to tokens list"
backLinkLabel=
"Back to tokens list"
additionalsLeft=
{
(
additionalsLeft=
{
(
...
...
ui/searchResults/SearchResultListItem.tsx
View file @
b7f8e650
...
@@ -7,6 +7,7 @@ import blockIcon from 'icons/block.svg';
...
@@ -7,6 +7,7 @@ import blockIcon from 'icons/block.svg';
import
txIcon
from
'
icons/transactions.svg
'
;
import
txIcon
from
'
icons/transactions.svg
'
;
import
highlightText
from
'
lib/highlightText
'
;
import
highlightText
from
'
lib/highlightText
'
;
import
link
from
'
lib/link/link
'
;
import
link
from
'
lib/link/link
'
;
import
trimTokenSymbol
from
'
lib/token/trimTokenSymbol
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
...
@@ -25,7 +26,7 @@ const SearchResultListItem = ({ data, searchTerm }: Props) => {
...
@@ -25,7 +26,7 @@ const SearchResultListItem = ({ data, searchTerm }: Props) => {
const
firstRow
=
(()
=>
{
const
firstRow
=
(()
=>
{
switch
(
data
.
type
)
{
switch
(
data
.
type
)
{
case
'
token
'
:
{
case
'
token
'
:
{
const
name
=
data
.
name
+
(
data
.
symbol
?
` (
${
data
.
symbol
}
)`
:
''
);
const
name
=
data
.
name
+
(
data
.
symbol
?
` (
${
trimTokenSymbol
(
data
.
symbol
)
}
)`
:
''
);
return
(
return
(
<
Flex
alignItems=
"flex-start"
>
<
Flex
alignItems=
"flex-start"
>
...
...
ui/searchResults/SearchResultTableItem.tsx
View file @
b7f8e650
...
@@ -7,6 +7,7 @@ import blockIcon from 'icons/block.svg';
...
@@ -7,6 +7,7 @@ import blockIcon from 'icons/block.svg';
import
txIcon
from
'
icons/transactions.svg
'
;
import
txIcon
from
'
icons/transactions.svg
'
;
import
highlightText
from
'
lib/highlightText
'
;
import
highlightText
from
'
lib/highlightText
'
;
import
link
from
'
lib/link/link
'
;
import
link
from
'
lib/link/link
'
;
import
trimTokenSymbol
from
'
lib/token/trimTokenSymbol
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
...
@@ -24,7 +25,7 @@ const SearchResultTableItem = ({ data, searchTerm }: Props) => {
...
@@ -24,7 +25,7 @@ const SearchResultTableItem = ({ data, searchTerm }: Props) => {
const
content
=
(()
=>
{
const
content
=
(()
=>
{
switch
(
data
.
type
)
{
switch
(
data
.
type
)
{
case
'
token
'
:
{
case
'
token
'
:
{
const
name
=
data
.
name
+
(
data
.
symbol
?
` (
${
data
.
symbol
}
)`
:
''
);
const
name
=
data
.
name
+
(
data
.
symbol
?
` (
${
trimTokenSymbol
(
data
.
symbol
)
}
)`
:
''
);
return
(
return
(
<>
<>
<
Td
fontSize=
"sm"
>
<
Td
fontSize=
"sm"
>
...
...
ui/token/TokenDetails.tsx
View file @
b7f8e650
...
@@ -103,15 +103,15 @@ const TokenDetails = ({ tokenQuery }: Props) => {
...
@@ -103,15 +103,15 @@ const TokenDetails = ({ tokenQuery }: Props) => {
{
`$${ totalValue?.usd }`
}
{
`$${ totalValue?.usd }`
}
</
DetailsInfoItem
>
</
DetailsInfoItem
>
)
}
)
}
{
totalValue
?.
valueStr
&&
(
<
DetailsInfoItem
<
DetailsInfoItem
title=
"Max total supply"
title=
"Max total supply
"
hint=
"The total amount of tokens issued.
"
hint=
"The total amount of tokens issued.
"
alignSelf=
"center
"
alignSelf=
"center
"
wordBreak=
"break-word
"
>
whiteSpace=
"pre-wrap"
{
`${ totalValue.valueStr } ${ symbol }`
}
>
</
DetailsInfoItem
>
{
`${ totalValue?.valueStr || 0 } ${ symbol || '' }`
}
)
}
</
DetailsInfoItem
>
<
DetailsInfoItem
<
DetailsInfoItem
title=
"Holders"
title=
"Holders"
hint=
"Number of accounts holding the token."
hint=
"Number of accounts holding the token."
...
...
ui/tx/NftTokenTransferSnippet.tsx
View file @
b7f8e650
...
@@ -4,6 +4,7 @@ import React from 'react';
...
@@ -4,6 +4,7 @@ import React from 'react';
import
nftIcon
from
'
icons/nft_shield.svg
'
;
import
nftIcon
from
'
icons/nft_shield.svg
'
;
import
link
from
'
lib/link/link
'
;
import
link
from
'
lib/link/link
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
HashStringShorten
from
'
ui/shared/HashStringShorten
'
;
import
TokenSnippet
from
'
ui/shared/TokenSnippet/TokenSnippet
'
;
import
TokenSnippet
from
'
ui/shared/TokenSnippet/TokenSnippet
'
;
interface
Props
{
interface
Props
{
...
@@ -23,7 +24,9 @@ const NftTokenTransferSnippet = ({ value, name, hash, symbol, tokenId }: Props)
...
@@ -23,7 +24,9 @@ const NftTokenTransferSnippet = ({ value, name, hash, symbol, tokenId }: Props)
<
Text
fontWeight=
{
500
}
as=
"span"
>
For
{
num
}
token ID:
</
Text
>
<
Text
fontWeight=
{
500
}
as=
"span"
>
For
{
num
}
token ID:
</
Text
>
<
Box
display=
"inline-flex"
alignItems=
"center"
>
<
Box
display=
"inline-flex"
alignItems=
"center"
>
<
Icon
as=
{
nftIcon
}
boxSize=
{
6
}
mr=
{
1
}
/>
<
Icon
as=
{
nftIcon
}
boxSize=
{
6
}
mr=
{
1
}
/>
<
Link
href=
{
url
}
fontWeight=
{
600
}
>
{
tokenId
}
</
Link
>
<
Link
href=
{
url
}
fontWeight=
{
600
}
overflow=
"hidden"
>
{
tokenId
.
length
>
8
?
<
HashStringShorten
hash=
{
tokenId
}
/>
:
tokenId
}
</
Link
>
</
Box
>
</
Box
>
{
name
?
(
{
name
?
(
<
TokenSnippet
symbol=
{
symbol
}
hash=
{
hash
}
name=
{
name
}
w=
"auto"
logoSize=
{
5
}
columnGap=
{
1
}
/>
<
TokenSnippet
symbol=
{
symbol
}
hash=
{
hash
}
name=
{
name
}
w=
"auto"
logoSize=
{
5
}
columnGap=
{
1
}
/>
...
...
ui/tx/__screenshots__/TxDetails.pw.tsx_default_with-token-transfer-mobile-1.png
View replaced file @
e9537340
View file @
b7f8e650
146 KB
|
W:
|
H:
150 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/tx/__screenshots__/TxDetails.pw.tsx_mobile_with-token-transfer-mobile-1.png
View replaced file @
e9537340
View file @
b7f8e650
132 KB
|
W:
|
H:
136 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/tx/details/TxDetailsTokenTransfer.tsx
View file @
b7f8e650
...
@@ -5,6 +5,7 @@ import type { TokenTransfer as TTokenTransfer, Erc20TotalPayload, Erc721TotalPay
...
@@ -5,6 +5,7 @@ import type { TokenTransfer as TTokenTransfer, Erc20TotalPayload, Erc721TotalPay
import
rightArrowIcon
from
'
icons/arrows/east.svg
'
;
import
rightArrowIcon
from
'
icons/arrows/east.svg
'
;
import
{
space
}
from
'
lib/html-entities
'
;
import
{
space
}
from
'
lib/html-entities
'
;
import
trimTokenSymbol
from
'
lib/token/trimTokenSymbol
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
TokenSnippet
from
'
ui/shared/TokenSnippet/TokenSnippet
'
;
import
TokenSnippet
from
'
ui/shared/TokenSnippet/TokenSnippet
'
;
...
@@ -26,7 +27,7 @@ const TxDetailsTokenTransfer = ({ token, total, to, from }: Props) => {
...
@@ -26,7 +27,7 @@ const TxDetailsTokenTransfer = ({ token, total, to, from }: Props) => {
<
CurrencyValue
value=
{
payload
.
value
}
exchangeRate=
{
token
.
exchange_rate
}
fontWeight=
{
600
}
/>
<
CurrencyValue
value=
{
payload
.
value
}
exchangeRate=
{
token
.
exchange_rate
}
fontWeight=
{
600
}
/>
</
Text
>
</
Text
>
<
TokenSnippet
<
TokenSnippet
symbol=
{
t
oken
.
symbol
}
symbol=
{
t
rimTokenSymbol
(
token
.
symbol
)
}
hash=
{
token
.
address
}
hash=
{
token
.
address
}
name=
{
token
.
name
}
name=
{
token
.
name
}
w=
"auto"
w=
"auto"
...
@@ -46,7 +47,7 @@ const TxDetailsTokenTransfer = ({ token, total, to, from }: Props) => {
...
@@ -46,7 +47,7 @@ const TxDetailsTokenTransfer = ({ token, total, to, from }: Props) => {
tokenId=
{
payload
.
token_id
}
tokenId=
{
payload
.
token_id
}
value=
"1"
value=
"1"
hash=
{
token
.
address
}
hash=
{
token
.
address
}
symbol=
{
t
oken
.
symbol
}
symbol=
{
t
rimTokenSymbol
(
token
.
symbol
)
}
/>
/>
);
);
}
}
...
@@ -61,7 +62,7 @@ const TxDetailsTokenTransfer = ({ token, total, to, from }: Props) => {
...
@@ -61,7 +62,7 @@ const TxDetailsTokenTransfer = ({ token, total, to, from }: Props) => {
tokenId=
{
item
.
token_id
}
tokenId=
{
item
.
token_id
}
value=
{
item
.
value
}
value=
{
item
.
value
}
hash=
{
token
.
address
}
hash=
{
token
.
address
}
symbol=
{
t
oken
.
symbol
}
symbol=
{
t
rimTokenSymbol
(
token
.
symbol
)
}
/>
/>
));
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment