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
7132117f
Commit
7132117f
authored
Aug 30, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove usage of TokenLogo
parent
d9b5b3c9
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
148 additions
and
110 deletions
+148
-110
AddressTokenTransfers.tsx
ui/address/AddressTokenTransfers.tsx
+4
-3
AddressBalance.tsx
ui/address/details/AddressBalance.tsx
+0
-13
ERC20TokensListItem.tsx
ui/address/tokens/ERC20TokensListItem.tsx
+8
-6
ERC20TokensTableItem.tsx
ui/address/tokens/ERC20TokensTableItem.tsx
+8
-8
ERC721TokensListItem.tsx
ui/address/tokens/ERC721TokensListItem.tsx
+9
-8
ERC721TokensTableItem.tsx
ui/address/tokens/ERC721TokensTableItem.tsx
+9
-7
NFTItem.tsx
ui/address/tokens/NFTItem.tsx
+7
-8
indicators.tsx
ui/home/indicators/utils/indicators.tsx
+4
-2
Token.tsx
ui/pages/Token.tsx
+6
-7
SearchResultListItem.tsx
ui/searchResults/SearchResultListItem.tsx
+2
-3
SearchResultTableItem.tsx
ui/searchResults/SearchResultTableItem.tsx
+2
-3
DefaultView.tsx
ui/shared/Page/specs/DefaultView.tsx
+5
-2
LongNameAndManyTags.tsx
ui/shared/Page/specs/LongNameAndManyTags.tsx
+5
-2
TokenLogo.tsx
ui/shared/TokenLogo.tsx
+1
-0
utils.ts
ui/shared/entities/base/utils.ts
+6
-1
TokenEntity.tsx
ui/shared/entities/token/TokenEntity.tsx
+15
-10
TokenEntityWithAddressFilter.tsx
ui/shared/entities/token/TokenEntityWithAddressFilter.tsx
+29
-0
TokenTransferTableItem.tsx
ui/token/TokenTransfer/TokenTransferTableItem.tsx
+2
-0
TokensListItem.tsx
ui/tokens/TokensListItem.tsx
+11
-11
TokensTableItem.tsx
ui/tokens/TokensTableItem.tsx
+10
-10
WatchListAddressItem.tsx
ui/watchlist/WatchlistTable/WatchListAddressItem.tsx
+5
-6
No files found.
ui/address/AddressTokenTransfers.tsx
View file @
7132117f
...
@@ -22,11 +22,11 @@ import TOKEN_TYPE from 'lib/token/tokenTypes';
...
@@ -22,11 +22,11 @@ import TOKEN_TYPE from 'lib/token/tokenTypes';
import
{
getTokenTransfersStub
}
from
'
stubs/token
'
;
import
{
getTokenTransfersStub
}
from
'
stubs/token
'
;
import
ActionBar
from
'
ui/shared/ActionBar
'
;
import
ActionBar
from
'
ui/shared/ActionBar
'
;
import
DataListDisplay
from
'
ui/shared/DataListDisplay
'
;
import
DataListDisplay
from
'
ui/shared/DataListDisplay
'
;
import
*
as
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
HashStringShorten
from
'
ui/shared/HashStringShorten
'
;
import
HashStringShorten
from
'
ui/shared/HashStringShorten
'
;
import
Pagination
from
'
ui/shared/pagination/Pagination
'
;
import
Pagination
from
'
ui/shared/pagination/Pagination
'
;
import
useQueryWithPages
from
'
ui/shared/pagination/useQueryWithPages
'
;
import
useQueryWithPages
from
'
ui/shared/pagination/useQueryWithPages
'
;
import
*
as
SocketNewItemsNotice
from
'
ui/shared/SocketNewItemsNotice
'
;
import
*
as
SocketNewItemsNotice
from
'
ui/shared/SocketNewItemsNotice
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
import
TokenTransferFilter
from
'
ui/shared/TokenTransfer/TokenTransferFilter
'
;
import
TokenTransferFilter
from
'
ui/shared/TokenTransfer/TokenTransferFilter
'
;
import
TokenTransferList
from
'
ui/shared/TokenTransfer/TokenTransferList
'
;
import
TokenTransferList
from
'
ui/shared/TokenTransfer/TokenTransferList
'
;
import
TokenTransferTable
from
'
ui/shared/TokenTransfer/TokenTransferTable
'
;
import
TokenTransferTable
from
'
ui/shared/TokenTransfer/TokenTransferTable
'
;
...
@@ -227,19 +227,20 @@ const AddressTokenTransfers = ({ scrollRef, overloadCount = OVERLOAD_COUNT }: Pr
...
@@ -227,19 +227,20 @@ const AddressTokenTransfers = ({ scrollRef, overloadCount = OVERLOAD_COUNT }: Pr
address
:
tokenFilter
||
''
,
address
:
tokenFilter
||
''
,
name
:
''
,
name
:
''
,
icon_url
:
''
,
icon_url
:
''
,
symbol
:
''
,
}),
[
tokenFilter
]);
}),
[
tokenFilter
]);
const
tokenFilterComponent
=
tokenFilter
&&
(
const
tokenFilterComponent
=
tokenFilter
&&
(
<
Flex
alignItems=
"center"
flexWrap=
"wrap"
mb=
{
{
base
:
isActionBarHidden
?
3
:
6
,
lg
:
0
}
}
mr=
{
4
}
>
<
Flex
alignItems=
"center"
flexWrap=
"wrap"
mb=
{
{
base
:
isActionBarHidden
?
3
:
6
,
lg
:
0
}
}
mr=
{
4
}
>
<
Text
whiteSpace=
"nowrap"
mr=
{
2
}
py=
{
1
}
>
Filtered by token
</
Text
>
<
Text
whiteSpace=
"nowrap"
mr=
{
2
}
py=
{
1
}
>
Filtered by token
</
Text
>
<
Flex
alignItems=
"center"
py=
{
1
}
>
<
Flex
alignItems=
"center"
py=
{
1
}
>
<
Token
Logo
data=
{
tokenData
}
boxSize=
{
6
}
mr=
{
2
}
/>
<
Token
Entity
.
Icon
token=
{
tokenData
}
isLoading=
{
isPlaceholderData
}
/>
{
isMobile
?
<
HashStringShorten
hash=
{
tokenFilter
}
/>
:
tokenFilter
}
{
isMobile
?
<
HashStringShorten
hash=
{
tokenFilter
}
/>
:
tokenFilter
}
<
Tooltip
label=
"Reset filter"
>
<
Tooltip
label=
"Reset filter"
>
<
Flex
>
<
Flex
>
<
Icon
<
Icon
as=
{
crossIcon
}
as=
{
crossIcon
}
boxSize=
{
6
}
boxSize=
{
5
}
ml=
{
1
}
ml=
{
1
}
color=
{
resetTokenIconColor
}
color=
{
resetTokenIconColor
}
cursor=
"pointer"
cursor=
"pointer"
...
...
ui/address/details/AddressBalance.tsx
View file @
7132117f
...
@@ -10,7 +10,6 @@ import useSocketChannel from 'lib/socket/useSocketChannel';
...
@@ -10,7 +10,6 @@ import useSocketChannel from 'lib/socket/useSocketChannel';
import
useSocketMessage
from
'
lib/socket/useSocketMessage
'
;
import
useSocketMessage
from
'
lib/socket/useSocketMessage
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
interface
Props
{
interface
Props
{
data
:
Pick
<
Address
,
'
block_number_balance_updated_at
'
|
'
coin_balance
'
|
'
hash
'
|
'
exchange_rate
'
>
;
data
:
Pick
<
Address
,
'
block_number_balance_updated_at
'
|
'
coin_balance
'
|
'
hash
'
|
'
exchange_rate
'
>
;
...
@@ -64,11 +63,6 @@ const AddressBalance = ({ data, isLoading }: Props) => {
...
@@ -64,11 +63,6 @@ const AddressBalance = ({ data, isLoading }: Props) => {
handler
:
handleNewCoinBalanceMessage
,
handler
:
handleNewCoinBalanceMessage
,
});
});
const
tokenData
=
React
.
useMemo
(()
=>
({
name
:
config
.
chain
.
currency
.
name
||
''
,
icon_url
:
''
,
}),
[
]);
return
(
return
(
<
DetailsInfoItem
<
DetailsInfoItem
title=
"Balance"
title=
"Balance"
...
@@ -77,13 +71,6 @@ const AddressBalance = ({ data, isLoading }: Props) => {
...
@@ -77,13 +71,6 @@ const AddressBalance = ({ data, isLoading }: Props) => {
alignItems=
"flex-start"
alignItems=
"flex-start"
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
>
>
<
TokenLogo
data=
{
tokenData
}
boxSize=
{
5
}
mr=
{
2
}
fontSize=
"sm"
isLoading=
{
isLoading
}
/>
<
CurrencyValue
<
CurrencyValue
value=
{
data
.
coin_balance
||
'
0
'
}
value=
{
data
.
coin_balance
||
'
0
'
}
exchangeRate=
{
data
.
exchange_rate
}
exchangeRate=
{
data
.
exchange_rate
}
...
...
ui/address/tokens/ERC20TokensListItem.tsx
View file @
7132117f
...
@@ -5,17 +5,14 @@ import type { AddressTokenBalance } from 'types/api/address';
...
@@ -5,17 +5,14 @@ import type { AddressTokenBalance } from 'types/api/address';
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
type
Props
=
AddressTokenBalance
&
{
isLoading
:
boolean
};
type
Props
=
AddressTokenBalance
&
{
isLoading
:
boolean
};
const
ERC20TokensListItem
=
({
token
,
value
,
isLoading
}:
Props
)
=>
{
const
ERC20TokensListItem
=
({
token
,
value
,
isLoading
}:
Props
)
=>
{
const
tokenString
=
[
token
.
name
,
token
.
symbol
&&
`(
${
token
.
symbol
}
)`
].
filter
(
Boolean
).
join
(
'
'
);
const
{
const
{
valueStr
:
tokenQuantity
,
valueStr
:
tokenQuantity
,
usd
:
tokenValue
,
usd
:
tokenValue
,
...
@@ -24,8 +21,13 @@ const ERC20TokensListItem = ({ token, value, isLoading }: Props) => {
...
@@ -24,8 +21,13 @@ const ERC20TokensListItem = ({ token, value, isLoading }: Props) => {
return
(
return
(
<
ListItemMobile
rowGap=
{
2
}
>
<
ListItemMobile
rowGap=
{
2
}
>
<
Flex
alignItems=
"center"
width=
"100%"
>
<
Flex
alignItems=
"center"
width=
"100%"
>
<
TokenLogo
data=
{
token
}
boxSize=
{
6
}
mr=
{
2
}
isLoading=
{
isLoading
}
/>
<
TokenEntity
<
AddressLink
fontWeight=
"700"
hash=
{
token
.
address
}
type=
"token"
alias=
{
tokenString
}
isLoading=
{
isLoading
}
/>
token=
{
token
}
isLoading=
{
isLoading
}
noCopy
jointSymbol
fontWeight=
"700"
/>
</
Flex
>
</
Flex
>
<
Flex
alignItems=
"center"
pl=
{
8
}
>
<
Flex
alignItems=
"center"
pl=
{
8
}
>
<
AddressEntity
<
AddressEntity
...
...
ui/address/tokens/ERC20TokensTableItem.tsx
View file @
7132117f
...
@@ -5,9 +5,8 @@ import type { AddressTokenBalance } from 'types/api/address';
...
@@ -5,9 +5,8 @@ import type { AddressTokenBalance } from 'types/api/address';
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
Token
Logo
from
'
ui/shared/TokenLogo
'
;
import
Token
Entity
from
'
ui/shared/entities/token/TokenEntity
'
;
type
Props
=
AddressTokenBalance
&
{
isLoading
:
boolean
};
type
Props
=
AddressTokenBalance
&
{
isLoading
:
boolean
};
...
@@ -17,8 +16,6 @@ const ERC20TokensTableItem = ({
...
@@ -17,8 +16,6 @@ const ERC20TokensTableItem = ({
isLoading
,
isLoading
,
}:
Props
)
=>
{
}:
Props
)
=>
{
const
tokenString
=
[
token
.
name
,
token
.
symbol
&&
`(
${
token
.
symbol
}
)`
].
filter
(
Boolean
).
join
(
'
'
);
const
{
const
{
valueStr
:
tokenQuantity
,
valueStr
:
tokenQuantity
,
usd
:
tokenValue
,
usd
:
tokenValue
,
...
@@ -27,10 +24,13 @@ const ERC20TokensTableItem = ({
...
@@ -27,10 +24,13 @@ const ERC20TokensTableItem = ({
return
(
return
(
<
Tr
>
<
Tr
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
Flex
alignItems=
"center"
>
<
TokenEntity
<
TokenLogo
data=
{
token
}
boxSize=
{
6
}
mr=
{
2
}
isLoading=
{
isLoading
}
/>
token=
{
token
}
<
AddressLink
fontWeight=
"700"
hash=
{
token
.
address
}
type=
"token"
alias=
{
tokenString
}
isLoading=
{
isLoading
}
/>
isLoading=
{
isLoading
}
</
Flex
>
noCopy
jointSymbol
fontWeight=
"700"
/>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
Flex
alignItems=
"center"
width=
"150px"
justifyContent=
"space-between"
>
<
Flex
alignItems=
"center"
width=
"150px"
justifyContent=
"space-between"
>
...
...
ui/address/tokens/ERC721TokensListItem.tsx
View file @
7132117f
...
@@ -5,10 +5,9 @@ import React from 'react';
...
@@ -5,10 +5,9 @@ import React from 'react';
import
type
{
AddressTokenBalance
}
from
'
types/api/address
'
;
import
type
{
AddressTokenBalance
}
from
'
types/api/address
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
TokenEntityWithAddressFilter
from
'
ui/shared/entities/token/TokenEntityWithAddressFilter
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
type
Props
=
AddressTokenBalance
&
{
isLoading
:
boolean
};
type
Props
=
AddressTokenBalance
&
{
isLoading
:
boolean
};
...
@@ -17,14 +16,16 @@ const ERC721TokensListItem = ({ token, value, isLoading }: Props) => {
...
@@ -17,14 +16,16 @@ const ERC721TokensListItem = ({ token, value, isLoading }: Props) => {
const
hash
=
router
.
query
.
hash
?.
toString
()
||
''
;
const
hash
=
router
.
query
.
hash
?.
toString
()
||
''
;
const
tokenString
=
[
token
.
name
,
token
.
symbol
&&
`(
${
token
.
symbol
}
)`
].
filter
(
Boolean
).
join
(
'
'
);
return
(
return
(
<
ListItemMobile
rowGap=
{
2
}
>
<
ListItemMobile
rowGap=
{
2
}
>
<
Flex
alignItems=
"center"
width=
"100%"
>
<
TokenEntityWithAddressFilter
<
TokenLogo
data=
{
token
}
boxSize=
{
6
}
mr=
{
2
}
isLoading=
{
isLoading
}
/>
token=
{
token
}
<
AddressLink
fontWeight=
"700"
hash=
{
hash
}
tokenHash=
{
token
.
address
}
type=
"address_token"
alias=
{
tokenString
}
isLoading=
{
isLoading
}
/>
isLoading=
{
isLoading
}
</
Flex
>
addressHash=
{
hash
}
noCopy
jointSymbol
fontWeight=
{
700
}
/>
<
Flex
alignItems=
"center"
pl=
{
8
}
>
<
Flex
alignItems=
"center"
pl=
{
8
}
>
<
AddressEntity
<
AddressEntity
address=
{
{
hash
:
token
.
address
}
}
address=
{
{
hash
:
token
.
address
}
}
...
...
ui/address/tokens/ERC721TokensTableItem.tsx
View file @
7132117f
...
@@ -5,9 +5,8 @@ import React from 'react';
...
@@ -5,9 +5,8 @@ import React from 'react';
import
type
{
AddressTokenBalance
}
from
'
types/api/address
'
;
import
type
{
AddressTokenBalance
}
from
'
types/api/address
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
Token
Logo
from
'
ui/shared/TokenLogo
'
;
import
Token
EntityWithAddressFilter
from
'
ui/shared/entities/token/TokenEntityWithAddressFilter
'
;
type
Props
=
AddressTokenBalance
&
{
isLoading
:
boolean
};
type
Props
=
AddressTokenBalance
&
{
isLoading
:
boolean
};
...
@@ -19,15 +18,18 @@ const ERC721TokensTableItem = ({
...
@@ -19,15 +18,18 @@ const ERC721TokensTableItem = ({
const
router
=
useRouter
();
const
router
=
useRouter
();
const
hash
=
router
.
query
.
hash
?.
toString
()
||
''
;
const
hash
=
router
.
query
.
hash
?.
toString
()
||
''
;
const
tokenString
=
[
token
.
name
,
token
.
symbol
&&
`(
${
token
.
symbol
}
)`
].
filter
(
Boolean
).
join
(
'
'
);
return
(
return
(
<
Tr
>
<
Tr
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
Flex
alignItems=
"center"
>
<
TokenEntityWithAddressFilter
<
TokenLogo
data=
{
token
}
boxSize=
{
6
}
mr=
{
2
}
isLoading=
{
isLoading
}
/>
token=
{
token
}
<
AddressLink
fontWeight=
"700"
hash=
{
hash
}
tokenHash=
{
token
.
address
}
type=
"address_token"
alias=
{
tokenString
}
isLoading=
{
isLoading
}
/>
addressHash=
{
hash
}
</
Flex
>
isLoading=
{
isLoading
}
noCopy
jointSymbol
fontWeight=
"700"
/>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
Flex
alignItems=
"center"
width=
"150px"
justifyContent=
"space-between"
>
<
Flex
alignItems=
"center"
width=
"150px"
justifyContent=
"space-between"
>
...
...
ui/address/tokens/NFTItem.tsx
View file @
7132117f
...
@@ -5,10 +5,9 @@ import type { AddressTokenBalance } from 'types/api/address';
...
@@ -5,10 +5,9 @@ import type { AddressTokenBalance } from 'types/api/address';
import
{
route
}
from
'
nextjs-routes
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
NftMedia
from
'
ui/shared/nft/NftMedia
'
;
import
NftMedia
from
'
ui/shared/nft/NftMedia
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
import
TruncatedTextTooltip
from
'
ui/shared/TruncatedTextTooltip
'
;
import
TruncatedTextTooltip
from
'
ui/shared/TruncatedTextTooltip
'
;
import
TruncatedValue
from
'
ui/shared/TruncatedValue
'
;
type
Props
=
AddressTokenBalance
&
{
isLoading
:
boolean
};
type
Props
=
AddressTokenBalance
&
{
isLoading
:
boolean
};
...
@@ -53,12 +52,12 @@ const NFTItem = ({ token, token_id: tokenId, token_instance: tokenInstance, isLo
...
@@ -53,12 +52,12 @@ const NFTItem = ({ token, token_id: tokenId, token_instance: tokenInstance, isLo
</
TruncatedTextTooltip
>
</
TruncatedTextTooltip
>
</
Flex
>
</
Flex
>
)
}
)
}
{
token
.
name
&&
(
<
TokenEntity
<
Flex
alignItems=
"center"
>
token=
{
token
}
<
TokenLogo
data=
{
token
}
boxSize=
{
6
}
ml=
{
1
}
mr=
{
1
}
isLoading=
{
isLoading
}
/>
isLoading=
{
isLoading
}
<
TruncatedValue
isLoading=
{
isLoading
}
value=
{
token
.
name
}
color=
"text_secondary"
/>
noCopy
</
Flex
>
noSymbol
)
}
/>
</
LinkBox
>
</
LinkBox
>
);
);
};
};
...
...
ui/home/indicators/utils/indicators.tsx
View file @
7132117f
...
@@ -7,7 +7,7 @@ import config from 'configs/app';
...
@@ -7,7 +7,7 @@ import config from 'configs/app';
import
globeIcon
from
'
icons/globe.svg
'
;
import
globeIcon
from
'
icons/globe.svg
'
;
import
txIcon
from
'
icons/transactions.svg
'
;
import
txIcon
from
'
icons/transactions.svg
'
;
import
{
sortByDateDesc
}
from
'
ui/shared/chart/utils/sorts
'
;
import
{
sortByDateDesc
}
from
'
ui/shared/chart/utils/sorts
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
import
*
as
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
const
dailyTxsIndicator
:
TChainIndicator
<
'
homepage_chart_txs
'
>
=
{
const
dailyTxsIndicator
:
TChainIndicator
<
'
homepage_chart_txs
'
>
=
{
id
:
'
daily_txs
'
,
id
:
'
daily_txs
'
,
...
@@ -30,13 +30,15 @@ const dailyTxsIndicator: TChainIndicator<'homepage_chart_txs'> = {
...
@@ -30,13 +30,15 @@ const dailyTxsIndicator: TChainIndicator<'homepage_chart_txs'> = {
const
nativeTokenData
=
{
const
nativeTokenData
=
{
name
:
config
.
chain
.
currency
.
name
||
''
,
name
:
config
.
chain
.
currency
.
name
||
''
,
icon_url
:
''
,
icon_url
:
''
,
symbol
:
''
,
address
:
''
,
};
};
const
coinPriceIndicator
:
TChainIndicator
<
'
homepage_chart_market
'
>
=
{
const
coinPriceIndicator
:
TChainIndicator
<
'
homepage_chart_market
'
>
=
{
id
:
'
coin_price
'
,
id
:
'
coin_price
'
,
title
:
`
${
config
.
chain
.
currency
.
symbol
}
price`
,
title
:
`
${
config
.
chain
.
currency
.
symbol
}
price`
,
value
:
(
stats
)
=>
'
$
'
+
Number
(
stats
.
coin_price
).
toLocaleString
(
undefined
,
{
minimumFractionDigits
:
2
,
maximumFractionDigits
:
6
}),
value
:
(
stats
)
=>
'
$
'
+
Number
(
stats
.
coin_price
).
toLocaleString
(
undefined
,
{
minimumFractionDigits
:
2
,
maximumFractionDigits
:
6
}),
icon
:
<
Token
Logo
data=
{
nativeTokenData
}
boxSize=
{
6
}
/>,
icon
:
<
Token
Entity
.
Icon
token=
{
nativeTokenData
}
iconSize=
"24"
/>,
hint
:
`
${
config
.
chain
.
currency
.
symbol
}
token daily price in USD.`
,
hint
:
`
${
config
.
chain
.
currency
.
symbol
}
token daily price in USD.`
,
api
:
{
api
:
{
resourceName
:
'
homepage_chart_market
'
,
resourceName
:
'
homepage_chart_market
'
,
...
...
ui/pages/Token.tsx
View file @
7132117f
...
@@ -24,6 +24,7 @@ import * as tokenStubs from 'stubs/token';
...
@@ -24,6 +24,7 @@ import * as tokenStubs from 'stubs/token';
import
{
generateListStub
}
from
'
stubs/utils
'
;
import
{
generateListStub
}
from
'
stubs/utils
'
;
import
AddressContract
from
'
ui/address/AddressContract
'
;
import
AddressContract
from
'
ui/address/AddressContract
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
import
*
as
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
EntityTags
from
'
ui/shared/EntityTags
'
;
import
EntityTags
from
'
ui/shared/EntityTags
'
;
import
NetworkExplorers
from
'
ui/shared/NetworkExplorers
'
;
import
NetworkExplorers
from
'
ui/shared/NetworkExplorers
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
...
@@ -31,7 +32,6 @@ import Pagination from 'ui/shared/pagination/Pagination';
...
@@ -31,7 +32,6 @@ import Pagination from 'ui/shared/pagination/Pagination';
import
useQueryWithPages
from
'
ui/shared/pagination/useQueryWithPages
'
;
import
useQueryWithPages
from
'
ui/shared/pagination/useQueryWithPages
'
;
import
RoutedTabs
from
'
ui/shared/Tabs/RoutedTabs
'
;
import
RoutedTabs
from
'
ui/shared/Tabs/RoutedTabs
'
;
import
TabsSkeleton
from
'
ui/shared/Tabs/TabsSkeleton
'
;
import
TabsSkeleton
from
'
ui/shared/Tabs/TabsSkeleton
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
import
TokenContractInfo
from
'
ui/token/TokenContractInfo
'
;
import
TokenContractInfo
from
'
ui/token/TokenContractInfo
'
;
import
TokenDetails
from
'
ui/token/TokenDetails
'
;
import
TokenDetails
from
'
ui/token/TokenDetails
'
;
import
TokenHolders
from
'
ui/token/TokenHolders/TokenHolders
'
;
import
TokenHolders
from
'
ui/token/TokenHolders/TokenHolders
'
;
...
@@ -270,14 +270,13 @@ const TokenPageContent = () => {
...
@@ -270,14 +270,13 @@ const TokenPageContent = () => {
title={ `
$
{
tokenQuery
.
data
?.
name
||
'
Unnamed token
'
}
$
{
tokenSymbolText
}
` }
title={ `
$
{
tokenQuery
.
data
?.
name
||
'
Unnamed token
'
}
$
{
tokenSymbolText
}
` }
isLoading={ tokenQuery.isPlaceholderData }
isLoading={ tokenQuery.isPlaceholderData }
backLink={ backLink }
backLink={ backLink }
beforeTitle={ (
beforeTitle={ tokenQuery.data ? (
<TokenLogo
<TokenEntity.Icon
data={ tokenQuery.data }
token={ tokenQuery.data }
boxSize={ 6 }
isLoading={ tokenQuery.isPlaceholderData }
isLoading={ tokenQuery.isPlaceholderData }
mr={ 2 }
iconSize="lg"
/>
/>
) }
)
: null
}
contentAfter={ titleContentAfter }
contentAfter={ titleContentAfter }
/>
/>
<TokenContractInfo tokenQuery={ tokenQuery } contractQuery={ contractQuery }/>
<TokenContractInfo tokenQuery={ tokenQuery } contractQuery={ contractQuery }/>
...
...
ui/searchResults/SearchResultListItem.tsx
View file @
7132117f
...
@@ -13,6 +13,7 @@ import * as mixpanel from 'lib/mixpanel/index';
...
@@ -13,6 +13,7 @@ import * as mixpanel from 'lib/mixpanel/index';
import
{
saveToRecentKeywords
}
from
'
lib/recentSearchKeywords
'
;
import
{
saveToRecentKeywords
}
from
'
lib/recentSearchKeywords
'
;
import
*
as
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
*
as
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
*
as
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
*
as
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
*
as
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
*
as
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
*
as
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
...
@@ -20,7 +21,6 @@ import LinkInternal from 'ui/shared/LinkInternal';
...
@@ -20,7 +21,6 @@ import LinkInternal from 'ui/shared/LinkInternal';
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
type
{
SearchResultAppItem
}
from
'
ui/shared/search/utils
'
;
import
type
{
SearchResultAppItem
}
from
'
ui/shared/search/utils
'
;
import
{
getItemCategory
,
searchItemTitles
}
from
'
ui/shared/search/utils
'
;
import
{
getItemCategory
,
searchItemTitles
}
from
'
ui/shared/search/utils
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
interface
Props
{
interface
Props
{
data
:
SearchResultItem
|
SearchResultAppItem
;
data
:
SearchResultItem
|
SearchResultAppItem
;
...
@@ -48,9 +48,8 @@ const SearchResultListItem = ({ data, searchTerm, isLoading }: Props) => {
...
@@ -48,9 +48,8 @@ const SearchResultListItem = ({ data, searchTerm, isLoading }: Props) => {
return
(
return
(
<
Flex
alignItems=
"flex-start"
flexGrow=
{
1
}
overflow=
"hidden"
>
<
Flex
alignItems=
"flex-start"
flexGrow=
{
1
}
overflow=
"hidden"
>
<
Token
Logo
boxSize=
{
6
}
data=
{
data
}
flexShrink=
{
0
}
isLoading=
{
isLoading
}
/>
<
Token
Entity
.
Icon
token=
{
data
}
isLoading=
{
isLoading
}
/>
<
LinkInternal
<
LinkInternal
ml=
{
2
}
href=
{
route
({
pathname
:
'
/token/[hash]
'
,
query
:
{
hash
:
data
.
address
}
})
}
href=
{
route
({
pathname
:
'
/token/[hash]
'
,
query
:
{
hash
:
data
.
address
}
})
}
fontWeight=
{
700
}
fontWeight=
{
700
}
wordBreak=
"break-all"
wordBreak=
"break-all"
...
...
ui/searchResults/SearchResultTableItem.tsx
View file @
7132117f
...
@@ -13,13 +13,13 @@ import * as mixpanel from 'lib/mixpanel/index';
...
@@ -13,13 +13,13 @@ import * as mixpanel from 'lib/mixpanel/index';
import
{
saveToRecentKeywords
}
from
'
lib/recentSearchKeywords
'
;
import
{
saveToRecentKeywords
}
from
'
lib/recentSearchKeywords
'
;
import
*
as
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
*
as
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
*
as
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
*
as
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
*
as
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
*
as
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
*
as
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
type
{
SearchResultAppItem
}
from
'
ui/shared/search/utils
'
;
import
type
{
SearchResultAppItem
}
from
'
ui/shared/search/utils
'
;
import
{
getItemCategory
,
searchItemTitles
}
from
'
ui/shared/search/utils
'
;
import
{
getItemCategory
,
searchItemTitles
}
from
'
ui/shared/search/utils
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
interface
Props
{
interface
Props
{
data
:
SearchResultItem
|
SearchResultAppItem
;
data
:
SearchResultItem
|
SearchResultAppItem
;
...
@@ -49,9 +49,8 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading }: Props) => {
...
@@ -49,9 +49,8 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading }: Props) => {
<>
<>
<
Td
fontSize=
"sm"
>
<
Td
fontSize=
"sm"
>
<
Flex
alignItems=
"center"
>
<
Flex
alignItems=
"center"
>
<
Token
Logo
boxSize=
{
6
}
data=
{
data
}
flexShrink=
{
0
}
isLoading=
{
isLoading
}
/>
<
Token
Entity
.
Icon
token=
{
data
}
isLoading=
{
isLoading
}
/>
<
LinkInternal
<
LinkInternal
ml=
{
2
}
href=
{
route
({
pathname
:
'
/token/[hash]
'
,
query
:
{
hash
:
data
.
address
}
})
}
href=
{
route
({
pathname
:
'
/token/[hash]
'
,
query
:
{
hash
:
data
.
address
}
})
}
fontWeight=
{
700
}
fontWeight=
{
700
}
wordBreak=
"break-all"
wordBreak=
"break-all"
...
...
ui/shared/Page/specs/DefaultView.tsx
View file @
7132117f
...
@@ -5,9 +5,9 @@ import type { TokenInfo } from 'types/api/token';
...
@@ -5,9 +5,9 @@ import type { TokenInfo } from 'types/api/token';
import
iconVerifiedToken
from
'
icons/verified_token.svg
'
;
import
iconVerifiedToken
from
'
icons/verified_token.svg
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
*
as
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
EntityTags
from
'
ui/shared/EntityTags
'
;
import
EntityTags
from
'
ui/shared/EntityTags
'
;
import
NetworkExplorers
from
'
ui/shared/NetworkExplorers
'
;
import
NetworkExplorers
from
'
ui/shared/NetworkExplorers
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
import
PageTitle
from
'
../PageTitle
'
;
import
PageTitle
from
'
../PageTitle
'
;
...
@@ -49,7 +49,10 @@ const DefaultView = () => {
...
@@ -49,7 +49,10 @@ const DefaultView = () => {
<
PageTitle
<
PageTitle
title=
"Shavukha Token (SHVKH) token"
title=
"Shavukha Token (SHVKH) token"
beforeTitle=
{
(
beforeTitle=
{
(
<
TokenLogo
data=
{
tokenData
}
boxSize=
{
6
}
mr=
{
2
}
/>
<
TokenEntity
.
Icon
token=
{
tokenData
}
iconSize=
"lg"
/>
)
}
)
}
backLink=
{
backLink
}
backLink=
{
backLink
}
contentAfter=
{
contentAfter
}
contentAfter=
{
contentAfter
}
...
...
ui/shared/Page/specs/LongNameAndManyTags.tsx
View file @
7132117f
...
@@ -7,9 +7,9 @@ import type { TokenInfo } from 'types/api/token';
...
@@ -7,9 +7,9 @@ import type { TokenInfo } from 'types/api/token';
import
iconVerifiedToken
from
'
icons/verified_token.svg
'
;
import
iconVerifiedToken
from
'
icons/verified_token.svg
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
{
publicTag
,
privateTag
,
watchlistName
}
from
'
mocks/address/tag
'
;
import
{
publicTag
,
privateTag
,
watchlistName
}
from
'
mocks/address/tag
'
;
import
*
as
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
EntityTags
from
'
ui/shared/EntityTags
'
;
import
EntityTags
from
'
ui/shared/EntityTags
'
;
import
NetworkExplorers
from
'
ui/shared/NetworkExplorers
'
;
import
NetworkExplorers
from
'
ui/shared/NetworkExplorers
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
import
PageTitle
from
'
../PageTitle
'
;
import
PageTitle
from
'
../PageTitle
'
;
...
@@ -57,7 +57,10 @@ const LongNameAndManyTags = () => {
...
@@ -57,7 +57,10 @@ const LongNameAndManyTags = () => {
<
PageTitle
<
PageTitle
title=
{
`${ tokenData?.name }${ tokenSymbolText } token`
}
title=
{
`${ tokenData?.name }${ tokenSymbolText } token`
}
beforeTitle=
{
(
beforeTitle=
{
(
<
TokenLogo
data=
{
tokenData
}
boxSize=
{
6
}
mr=
{
2
}
/>
<
TokenEntity
.
Icon
token=
{
tokenData
}
iconSize=
"lg"
/>
)
}
)
}
contentAfter=
{
contentAfter
}
contentAfter=
{
contentAfter
}
/>
/>
...
...
ui/shared/TokenLogo.tsx
View file @
7132117f
...
@@ -11,6 +11,7 @@ export interface Props {
...
@@ -11,6 +11,7 @@ export interface Props {
isLoading
?:
boolean
;
isLoading
?:
boolean
;
}
}
// TODO @tom2drum - remove this component
const
TokenLogo
=
({
className
,
isLoading
,
data
}:
Props
)
=>
{
const
TokenLogo
=
({
className
,
isLoading
,
data
}:
Props
)
=>
{
if
(
isLoading
)
{
if
(
isLoading
)
{
...
...
ui/shared/entities/base/utils.ts
View file @
7132117f
export
type
IconSize
=
'
md
'
|
'
lg
'
;
export
type
IconSize
=
'
md
'
|
'
lg
'
|
'
24
'
;
export
function
getIconProps
(
size
:
IconSize
=
'
md
'
)
{
export
function
getIconProps
(
size
:
IconSize
=
'
md
'
)
{
switch
(
size
)
{
switch
(
size
)
{
...
@@ -12,5 +12,10 @@ export function getIconProps(size: IconSize = 'md') {
...
@@ -12,5 +12,10 @@ export function getIconProps(size: IconSize = 'md') {
boxSize
:
'
30px
'
,
// for headings
boxSize
:
'
30px
'
,
// for headings
};
};
}
}
case
'
24
'
:
{
return
{
boxSize
:
'
24px
'
,
// deprecated
};
}
}
}
}
}
ui/shared/entities/token/TokenEntity.tsx
View file @
7132117f
...
@@ -28,11 +28,11 @@ const Link = chakra((props: LinkProps) => {
...
@@ -28,11 +28,11 @@ const Link = chakra((props: LinkProps) => {
);
);
});
});
type
IconProps
=
Pick
<
EntityProps
,
'
token
'
|
'
isLoading
'
|
'
iconSize
'
|
'
noIcon
'
>
&
{
type
IconProps
=
Pick
<
EntityProps
,
'
token
'
|
'
isLoading
'
|
'
iconSize
'
|
'
noIcon
'
|
'
className
'
>
&
{
asProp
?:
As
;
asProp
?:
As
;
};
};
const
Icon
=
(
props
:
IconProps
)
=>
{
const
Icon
=
chakra
(
(
props
:
IconProps
)
=>
{
if
(
props
.
noIcon
)
{
if
(
props
.
noIcon
)
{
return
null
;
return
null
;
}
}
...
@@ -44,26 +44,30 @@ const Icon = (props: IconProps) => {
...
@@ -44,26 +44,30 @@ const Icon = (props: IconProps) => {
};
};
if
(
props
.
isLoading
)
{
if
(
props
.
isLoading
)
{
return
<
Skeleton
{
...
styles
}
flexShrink=
{
0
}
/>;
return
<
Skeleton
{
...
styles
}
className=
{
props
.
className
}
flexShrink=
{
0
}
/>;
}
}
return
(
return
(
<
Image
<
Image
{
...
styles
}
{
...
styles
}
className=
{
props
.
className
}
src=
{
props
.
token
.
icon_url
??
undefined
}
src=
{
props
.
token
.
icon_url
??
undefined
}
alt=
{
`${ props.token.name || 'token' } logo`
}
alt=
{
`${ props.token.name || 'token' } logo`
}
fallback=
{
<
TokenLogoPlaceholder
{
...
styles
}
/>
}
fallback=
{
<
TokenLogoPlaceholder
{
...
styles
}
/>
}
/>
/>
);
);
};
}
)
;
type
ContentProps
=
Omit
<
EntityBase
.
ContentBaseProps
,
'
text
'
>
&
Pick
<
EntityProps
,
'
token
'
>
;
type
ContentProps
=
Omit
<
EntityBase
.
ContentBaseProps
,
'
text
'
>
&
Pick
<
EntityProps
,
'
token
'
|
'
jointSymbol
'
>
;
const
Content
=
chakra
((
props
:
ContentProps
)
=>
{
const
Content
=
chakra
((
props
:
ContentProps
)
=>
{
const
name
=
props
.
token
.
name
??
'
Unnamed token
'
;
const
nameString
=
[
props
.
token
.
name
??
'
Unnamed token
'
,
props
.
token
.
symbol
&&
props
.
jointSymbol
&&
`(
${
props
.
token
.
symbol
}
)`
,
].
filter
(
Boolean
).
join
(
'
'
);
return
(
return
(
<
TruncatedTextTooltip
label=
{
name
}
>
<
TruncatedTextTooltip
label=
{
name
String
}
>
<
Skeleton
<
Skeleton
isLoaded=
{
!
props
.
isLoading
}
isLoaded=
{
!
props
.
isLoading
}
display=
"inline-block"
display=
"inline-block"
...
@@ -72,18 +76,18 @@ const Content = chakra((props: ContentProps) => {
...
@@ -72,18 +76,18 @@ const Content = chakra((props: ContentProps) => {
textOverflow=
"ellipsis"
textOverflow=
"ellipsis"
height=
"fit-content"
height=
"fit-content"
>
>
{
name
}
{
name
String
}
</
Skeleton
>
</
Skeleton
>
</
TruncatedTextTooltip
>
</
TruncatedTextTooltip
>
);
);
});
});
type
SymbolProps
=
Pick
<
EntityProps
,
'
token
'
|
'
isLoading
'
|
'
noSymbol
'
>
;
type
SymbolProps
=
Pick
<
EntityProps
,
'
token
'
|
'
isLoading
'
|
'
noSymbol
'
|
'
jointSymbol
'
>
;
const
Symbol
=
(
props
:
SymbolProps
)
=>
{
const
Symbol
=
(
props
:
SymbolProps
)
=>
{
const
symbol
=
props
.
token
.
symbol
;
const
symbol
=
props
.
token
.
symbol
;
if
(
!
symbol
||
props
.
noSymbol
)
{
if
(
!
symbol
||
props
.
noSymbol
||
props
.
jointSymbol
)
{
return
null
;
return
null
;
}
}
...
@@ -129,6 +133,7 @@ const Container = EntityBase.Container;
...
@@ -129,6 +133,7 @@ const Container = EntityBase.Container;
export
interface
EntityProps
extends
EntityBase
.
EntityBaseProps
{
export
interface
EntityProps
extends
EntityBase
.
EntityBaseProps
{
token
:
Pick
<
TokenInfo
,
'
address
'
|
'
icon_url
'
|
'
name
'
|
'
symbol
'
>
;
token
:
Pick
<
TokenInfo
,
'
address
'
|
'
icon_url
'
|
'
name
'
|
'
symbol
'
>
;
noSymbol
?:
boolean
;
noSymbol
?:
boolean
;
jointSymbol
?:
boolean
;
}
}
const
TokenEntity
=
(
props
:
EntityProps
)
=>
{
const
TokenEntity
=
(
props
:
EntityProps
)
=>
{
...
...
ui/shared/entities/token/TokenEntityWithAddressFilter.tsx
0 → 100644
View file @
7132117f
import
{
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
*
as
TokenEntity
from
'
./TokenEntity
'
;
interface
Props
extends
TokenEntity
.
EntityProps
{
addressHash
:
string
;
}
const
TokenEntityWithAddressFilter
=
(
props
:
Props
)
=>
{
const
defaultHref
=
route
({
pathname
:
'
/address/[hash]
'
,
query
:
{
...
props
.
query
,
hash
:
props
.
addressHash
,
tab
:
'
token_transfers
'
,
token
:
props
.
token
.
address
,
scroll_to_tabs
:
'
true
'
,
},
});
return
(
<
TokenEntity
.
default
{
...
props
}
href=
{
props
.
href
??
defaultHref
}
/>
);
};
export
default
chakra
(
TokenEntityWithAddressFilter
);
ui/token/TokenTransfer/TokenTransferTableItem.tsx
View file @
7132117f
...
@@ -59,6 +59,7 @@ const TokenTransferTableItem = ({
...
@@ -59,6 +59,7 @@ const TokenTransferTableItem = ({
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
truncation=
"constant"
truncation=
"constant"
tokenHash=
{
token
.
address
}
tokenHash=
{
token
.
address
}
my=
"5px"
/>
/>
</
Td
>
</
Td
>
<
Td
px=
{
0
}
>
<
Td
px=
{
0
}
>
...
@@ -72,6 +73,7 @@ const TokenTransferTableItem = ({
...
@@ -72,6 +73,7 @@ const TokenTransferTableItem = ({
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
truncation=
"constant"
truncation=
"constant"
tokenHash=
{
token
.
address
}
tokenHash=
{
token
.
address
}
my=
"5px"
/>
/>
</
Td
>
</
Td
>
{
(
token
.
type
===
'
ERC-721
'
||
token
.
type
===
'
ERC-1155
'
)
&&
(
{
(
token
.
type
===
'
ERC-721
'
||
token
.
type
===
'
ERC-1155
'
)
&&
(
...
...
ui/tokens/TokensListItem.tsx
View file @
7132117f
...
@@ -5,11 +5,10 @@ import React from 'react';
...
@@ -5,11 +5,10 @@ import React from 'react';
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
type
Props
=
{
type
Props
=
{
token
:
TokenInfo
;
token
:
TokenInfo
;
...
@@ -31,14 +30,10 @@ const TokensTableItem = ({
...
@@ -31,14 +30,10 @@ const TokensTableItem = ({
address
,
address
,
exchange_rate
:
exchangeRate
,
exchange_rate
:
exchangeRate
,
type
,
type
,
name
,
symbol
,
holders
,
holders
,
circulating_market_cap
:
marketCap
,
circulating_market_cap
:
marketCap
,
}
=
token
;
}
=
token
;
const
tokenString
=
[
name
,
symbol
&&
`(
${
symbol
}
)`
].
filter
(
Boolean
).
join
(
'
'
);
return
(
return
(
<
ListItemMobile
rowGap=
{
3
}
>
<
ListItemMobile
rowGap=
{
3
}
>
<
Grid
<
Grid
...
@@ -46,11 +41,16 @@ const TokensTableItem = ({
...
@@ -46,11 +41,16 @@ const TokensTableItem = ({
gridTemplateColumns=
"minmax(0, 1fr)"
gridTemplateColumns=
"minmax(0, 1fr)"
>
>
<
GridItem
display=
"flex"
>
<
GridItem
display=
"flex"
>
<
Flex
overflow=
"hidden"
mr=
{
3
}
alignItems=
"center"
>
<
TokenEntity
<
TokenLogo
data=
{
token
}
boxSize=
{
6
}
mr=
{
2
}
isLoading=
{
isLoading
}
/>
token=
{
token
}
<
AddressLink
fontSize=
"sm"
fontWeight=
"700"
hash=
{
address
}
type=
"token"
alias=
{
tokenString
}
isLoading=
{
isLoading
}
mr=
{
3
}
/>
isLoading=
{
isLoading
}
<
Tag
flexShrink=
{
0
}
isLoading=
{
isLoading
}
>
{
type
}
</
Tag
>
jointSymbol
</
Flex
>
noCopy
w=
"auto"
fontSize=
"sm"
fontWeight=
"700"
/>
<
Tag
flexShrink=
{
0
}
isLoading=
{
isLoading
}
ml=
{
3
}
>
{
type
}
</
Tag
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
ml=
"auto"
color=
"text_secondary"
minW=
"24px"
textAlign=
"right"
lineHeight=
{
6
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
ml=
"auto"
color=
"text_secondary"
minW=
"24px"
textAlign=
"right"
lineHeight=
{
6
}
>
<
span
>
{
(
page
-
1
)
*
PAGE_SIZE
+
index
+
1
}
</
span
>
<
span
>
{
(
page
-
1
)
*
PAGE_SIZE
+
index
+
1
}
</
span
>
</
Skeleton
>
</
Skeleton
>
...
...
ui/tokens/TokensTableItem.tsx
View file @
7132117f
...
@@ -5,11 +5,10 @@ import React from 'react';
...
@@ -5,11 +5,10 @@ import React from 'react';
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
type
{
EntityProps
as
AddressEntityProps
}
from
'
ui/shared/entities/address/AddressEntity
'
;
import
type
{
EntityProps
as
AddressEntityProps
}
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
Token
Logo
from
'
ui/shared/TokenLogo
'
;
import
Token
Entity
from
'
ui/shared/entities/token/TokenEntity
'
;
type
Props
=
{
type
Props
=
{
token
:
TokenInfo
;
token
:
TokenInfo
;
...
@@ -31,13 +30,10 @@ const TokensTableItem = ({
...
@@ -31,13 +30,10 @@ const TokensTableItem = ({
address
,
address
,
exchange_rate
:
exchangeRate
,
exchange_rate
:
exchangeRate
,
type
,
type
,
name
,
symbol
,
holders
,
holders
,
circulating_market_cap
:
marketCap
,
circulating_market_cap
:
marketCap
,
}
=
token
;
}
=
token
;
const
tokenString
=
[
name
,
symbol
&&
`(
${
symbol
}
)`
].
filter
(
Boolean
).
join
(
'
'
);
const
tokenAddress
:
AddressEntityProps
[
'
address
'
]
=
{
const
tokenAddress
:
AddressEntityProps
[
'
address
'
]
=
{
hash
:
address
,
hash
:
address
,
name
:
''
,
name
:
''
,
...
@@ -53,7 +49,7 @@ const TokensTableItem = ({
...
@@ -53,7 +49,7 @@ const TokensTableItem = ({
<
Skeleton
<
Skeleton
isLoaded=
{
!
isLoading
}
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontSize=
"sm"
lineHeight=
"2
4
px"
lineHeight=
"2
0
px"
fontWeight=
{
600
}
fontWeight=
{
600
}
mr=
{
3
}
mr=
{
3
}
minW=
"28px"
minW=
"28px"
...
@@ -61,10 +57,14 @@ const TokensTableItem = ({
...
@@ -61,10 +57,14 @@ const TokensTableItem = ({
{
(
page
-
1
)
*
PAGE_SIZE
+
index
+
1
}
{
(
page
-
1
)
*
PAGE_SIZE
+
index
+
1
}
</
Skeleton
>
</
Skeleton
>
<
Box
overflow=
"hidden"
>
<
Box
overflow=
"hidden"
>
<
Flex
alignItems=
"center"
>
<
TokenEntity
<
TokenLogo
data=
{
token
}
boxSize=
{
6
}
mr=
{
2
}
isLoading=
{
isLoading
}
/>
token=
{
token
}
<
AddressLink
fontSize=
"sm"
fontWeight=
"700"
hash=
{
address
}
type=
"token"
alias=
{
tokenString
}
isLoading=
{
isLoading
}
/>
isLoading=
{
isLoading
}
</
Flex
>
jointSymbol
noCopy
fontSize=
"sm"
fontWeight=
"700"
/>
<
Box
ml=
{
8
}
mt=
{
2
}
>
<
Box
ml=
{
8
}
mt=
{
2
}
>
<
Flex
>
<
Flex
>
<
AddressEntity
<
AddressEntity
...
...
ui/watchlist/WatchlistTable/WatchListAddressItem.tsx
View file @
7132117f
...
@@ -12,7 +12,7 @@ import { nbsp } from 'lib/html-entities';
...
@@ -12,7 +12,7 @@ import { nbsp } from 'lib/html-entities';
import
Icon
from
'
ui/shared/chakra/Icon
'
;
import
Icon
from
'
ui/shared/chakra/Icon
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
import
*
as
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
const
WatchListAddressItem
=
({
item
,
isLoading
}:
{
item
:
WatchlistAddress
;
isLoading
?:
boolean
})
=>
{
const
WatchListAddressItem
=
({
item
,
isLoading
}:
{
item
:
WatchlistAddress
;
isLoading
?:
boolean
})
=>
{
const
infoItemsPaddingLeft
=
{
base
:
1
,
lg
:
8
};
const
infoItemsPaddingLeft
=
{
base
:
1
,
lg
:
8
};
...
@@ -20,6 +20,8 @@ const WatchListAddressItem = ({ item, isLoading }: { item: WatchlistAddress; isL
...
@@ -20,6 +20,8 @@ const WatchListAddressItem = ({ item, isLoading }: { item: WatchlistAddress; isL
const
nativeTokenData
=
React
.
useMemo
(()
=>
({
const
nativeTokenData
=
React
.
useMemo
(()
=>
({
name
:
config
.
chain
.
currency
.
name
||
''
,
name
:
config
.
chain
.
currency
.
name
||
''
,
icon_url
:
''
,
icon_url
:
''
,
symbol
:
''
,
address
:
''
,
}),
[
]);
}),
[
]);
const
{
usdBn
:
usdNative
}
=
getCurrencyValue
({
value
:
item
.
address_balance
,
accuracy
:
2
,
accuracyUsd
:
2
,
exchangeRate
:
item
.
exchange_rate
});
const
{
usdBn
:
usdNative
}
=
getCurrencyValue
({
value
:
item
.
address_balance
,
accuracy
:
2
,
accuracyUsd
:
2
,
exchangeRate
:
item
.
exchange_rate
});
...
@@ -33,11 +35,8 @@ const WatchListAddressItem = ({ item, isLoading }: { item: WatchlistAddress; isL
...
@@ -33,11 +35,8 @@ const WatchListAddressItem = ({ item, isLoading }: { item: WatchlistAddress; isL
py=
"2px"
py=
"2px"
/>
/>
<
Flex
fontSize=
"sm"
pl=
{
infoItemsPaddingLeft
}
flexWrap=
"wrap"
alignItems=
"center"
rowGap=
{
1
}
>
<
Flex
fontSize=
"sm"
pl=
{
infoItemsPaddingLeft
}
flexWrap=
"wrap"
alignItems=
"center"
rowGap=
{
1
}
>
<
TokenLogo
<
TokenEntity
.
Icon
data=
{
nativeTokenData
}
token=
{
nativeTokenData
}
boxSize=
{
5
}
borderRadius=
"sm"
mr=
{
2
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
/>
/>
<
Skeleton
isLoaded=
{
!
isLoading
}
whiteSpace=
"pre"
display=
"inline-flex"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
whiteSpace=
"pre"
display=
"inline-flex"
>
...
...
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