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
401f4962
Commit
401f4962
authored
Aug 29, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove usage of AddressIcon
parent
b17946c5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
68 deletions
+70
-68
ContractConnectWallet.tsx
ui/address/contract/ContractConnectWallet.tsx
+7
-4
DepositsListItem.tsx
ui/l2Deposits/DepositsListItem.tsx
+9
-20
DepositsTableItem.tsx
ui/l2Deposits/DepositsTableItem.tsx
+6
-16
WithdrawalsListItem.tsx
ui/l2Withdrawals/WithdrawalsListItem.tsx
+0
-4
AddressHeadingInfo.tsx
ui/shared/AddressHeadingInfo.tsx
+5
-11
AddressEntityL1.tsx
ui/shared/entities/address/AddressEntityL1.tsx
+30
-0
VerifiedContractsTableItem.tsx
ui/verifiedContracts/VerifiedContractsTableItem.tsx
+13
-13
No files found.
ui/address/contract/ContractConnectWallet.tsx
View file @
401f4962
...
@@ -4,8 +4,7 @@ import React from 'react';
...
@@ -4,8 +4,7 @@ import React from 'react';
import
{
useAccount
,
useDisconnect
}
from
'
wagmi
'
;
import
{
useAccount
,
useDisconnect
}
from
'
wagmi
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
const
ContractConnectWallet
=
()
=>
{
const
ContractConnectWallet
=
()
=>
{
const
{
open
,
isOpen
}
=
useWeb3Modal
();
const
{
open
,
isOpen
}
=
useWeb3Modal
();
...
@@ -47,8 +46,12 @@ const ContractConnectWallet = () => {
...
@@ -47,8 +46,12 @@ const ContractConnectWallet = () => {
<
Flex
columnGap=
{
3
}
rowGap=
{
3
}
alignItems=
{
{
base
:
'
flex-start
'
,
lg
:
'
center
'
}
}
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
>
<
Flex
columnGap=
{
3
}
rowGap=
{
3
}
alignItems=
{
{
base
:
'
flex-start
'
,
lg
:
'
center
'
}
}
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
>
<
Flex
alignItems=
"center"
>
<
Flex
alignItems=
"center"
>
<
span
>
Connected to
</
span
>
<
span
>
Connected to
</
span
>
<
AddressIcon
address=
{
{
hash
:
address
,
is_contract
:
false
,
implementation_name
:
null
}
}
mx=
{
2
}
/>
<
AddressEntity
<
AddressLink
type=
"address"
fontWeight=
{
600
}
hash=
{
address
}
truncation=
{
isMobile
?
'
constant
'
:
'
dynamic
'
}
/>
address=
{
{
hash
:
address
,
name
:
''
,
is_contract
:
false
,
implementation_name
:
null
}
}
truncation=
{
isMobile
?
'
constant
'
:
'
dynamic
'
}
fontWeight=
{
600
}
ml=
{
2
}
/>
</
Flex
>
</
Flex
>
<
Button
onClick=
{
handleDisconnect
}
size=
"sm"
variant=
"outline"
>
Disconnect
</
Button
>
<
Button
onClick=
{
handleDisconnect
}
size=
"sm"
variant=
"outline"
>
Disconnect
</
Button
>
</
Flex
>
</
Flex
>
...
...
ui/l2Deposits/DepositsListItem.tsx
View file @
401f4962
...
@@ -4,16 +4,12 @@ import React from 'react';
...
@@ -4,16 +4,12 @@ import React from 'react';
import
type
{
L2DepositsItem
}
from
'
types/api/l2Deposits
'
;
import
type
{
L2DepositsItem
}
from
'
types/api/l2Deposits
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
Address
Icon
from
'
ui/shared/address/AddressIcon
'
;
import
Address
EntityL1
from
'
ui/shared/entities/address/AddressEntityL1
'
;
import
BlockEntityL1
from
'
ui/shared/entities/block/BlockEntityL1
'
;
import
BlockEntityL1
from
'
ui/shared/entities/block/BlockEntityL1
'
;
import
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
TxEntityL1
from
'
ui/shared/entities/tx/TxEntityL1
'
;
import
TxEntityL1
from
'
ui/shared/entities/tx/TxEntityL1
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
ListItemMobileGrid
from
'
ui/shared/ListItemMobile/ListItemMobileGrid
'
;
import
ListItemMobileGrid
from
'
ui/shared/ListItemMobile/ListItemMobileGrid
'
;
const
feature
=
config
.
features
.
rollup
;
const
feature
=
config
.
features
.
rollup
;
...
@@ -31,7 +27,7 @@ const DepositsListItem = ({ item, isLoading }: Props) => {
...
@@ -31,7 +27,7 @@ const DepositsListItem = ({ item, isLoading }: Props) => {
<
ListItemMobileGrid
.
Container
>
<
ListItemMobileGrid
.
Container
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
L1 block No
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
L1 block No
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
py=
"3px"
>
<
ListItemMobileGrid
.
Value
>
<
BlockEntityL1
<
BlockEntityL1
number=
{
item
.
l1_block_number
}
number=
{
item
.
l1_block_number
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
...
@@ -42,7 +38,7 @@ const DepositsListItem = ({ item, isLoading }: Props) => {
...
@@ -42,7 +38,7 @@ const DepositsListItem = ({ item, isLoading }: Props) => {
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
L2 txn hash
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
L2 txn hash
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
py=
"3px"
>
<
ListItemMobileGrid
.
Value
>
<
TxEntity
<
TxEntity
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
hash=
{
item
.
l2_tx_hash
}
hash=
{
item
.
l2_tx_hash
}
...
@@ -57,7 +53,7 @@ const DepositsListItem = ({ item, isLoading }: Props) => {
...
@@ -57,7 +53,7 @@ const DepositsListItem = ({ item, isLoading }: Props) => {
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
L1 txn hash
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
L1 txn hash
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
py=
"3px"
>
<
ListItemMobileGrid
.
Value
>
<
TxEntityL1
<
TxEntityL1
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
hash=
{
item
.
l1_tx_hash
}
hash=
{
item
.
l1_tx_hash
}
...
@@ -67,19 +63,12 @@ const DepositsListItem = ({ item, isLoading }: Props) => {
...
@@ -67,19 +63,12 @@ const DepositsListItem = ({ item, isLoading }: Props) => {
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
L1 txn origin
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
L1 txn origin
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
py=
"3px"
>
<
ListItemMobileGrid
.
Value
>
<
LinkExternal
<
AddressEntityL1
href=
{
feature
.
L1BaseUrl
+
route
({
pathname
:
'
/address/[hash]
'
,
query
:
{
hash
:
item
.
l1_tx_origin
}
})
}
address=
{
{
hash
:
item
.
l1_tx_origin
,
name
:
''
,
is_contract
:
false
,
is_verified
:
false
,
implementation_name
:
''
}
}
maxW=
"100%"
display=
"flex"
overflow=
"hidden"
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
>
noCopy
<
AddressIcon
address=
{
{
hash
:
item
.
l1_tx_origin
,
is_contract
:
false
,
implementation_name
:
''
}
}
isLoading=
{
isLoading
}
/>
/>
<
Skeleton
isLoaded=
{
!
isLoading
}
w=
"calc(100% - 44px)"
overflow=
"hidden"
whiteSpace=
"nowrap"
ml=
{
2
}
>
<
HashStringShortenDynamic
hash=
{
item
.
l1_tx_origin
}
/>
</
Skeleton
>
</
LinkExternal
>
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Gas limit
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Gas limit
</
ListItemMobileGrid
.
Label
>
...
...
ui/l2Deposits/DepositsTableItem.tsx
View file @
401f4962
...
@@ -4,16 +4,12 @@ import React from 'react';
...
@@ -4,16 +4,12 @@ import React from 'react';
import
type
{
L2DepositsItem
}
from
'
types/api/l2Deposits
'
;
import
type
{
L2DepositsItem
}
from
'
types/api/l2Deposits
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
Address
Icon
from
'
ui/shared/address/AddressIcon
'
;
import
Address
EntityL1
from
'
ui/shared/entities/address/AddressEntityL1
'
;
import
BlockEntityL1
from
'
ui/shared/entities/block/BlockEntityL1
'
;
import
BlockEntityL1
from
'
ui/shared/entities/block/BlockEntityL1
'
;
import
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
TxEntityL1
from
'
ui/shared/entities/tx/TxEntityL1
'
;
import
TxEntityL1
from
'
ui/shared/entities/tx/TxEntityL1
'
;
import
HashStringShorten
from
'
ui/shared/HashStringShorten
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
const
feature
=
config
.
features
.
rollup
;
const
feature
=
config
.
features
.
rollup
;
...
@@ -59,18 +55,12 @@ const WithdrawalsTableItem = ({ item, isLoading }: Props) => {
...
@@ -59,18 +55,12 @@ const WithdrawalsTableItem = ({ item, isLoading }: Props) => {
/>
/>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
LinkExternal
<
AddressEntityL1
href=
{
feature
.
L1BaseUrl
+
route
({
pathname
:
'
/address/[hash]
'
,
query
:
{
hash
:
item
.
l1_tx_origin
}
})
}
address=
{
{
hash
:
item
.
l1_tx_origin
,
name
:
''
,
is_contract
:
false
,
is_verified
:
false
,
implementation_name
:
''
}
}
maxW=
"100%"
display=
"inline-flex"
overflow=
"hidden"
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
>
truncation=
"constant"
<
AddressIcon
address=
{
{
hash
:
item
.
l1_tx_origin
,
is_contract
:
false
,
implementation_name
:
''
}
}
isLoading=
{
isLoading
}
/>
noCopy
<
Skeleton
isLoaded=
{
!
isLoading
}
w=
"calc(100% - 44px)"
overflow=
"hidden"
whiteSpace=
"nowrap"
ml=
{
2
}
>
/>
<
HashStringShorten
hash=
{
item
.
l1_tx_origin
}
/>
</
Skeleton
>
</
LinkExternal
>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
isNumeric
>
<
Td
verticalAlign=
"middle"
isNumeric
>
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_secondary"
display=
"inline-block"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_secondary"
display=
"inline-block"
>
...
...
ui/l2Withdrawals/WithdrawalsListItem.tsx
View file @
401f4962
...
@@ -41,10 +41,6 @@ const WithdrawalsListItem = ({ item, isLoading }: Props) => {
...
@@ -41,10 +41,6 @@ const WithdrawalsListItem = ({ item, isLoading }: Props) => {
address=
{
item
.
from
}
address=
{
item
.
from
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
/>
/>
{
/* <Address>
<AddressIcon address={ item.from } isLoading={ isLoading }/>
<AddressLink hash={ item.from.hash } type="address" truncation="dynamic" ml={ 2 } isLoading={ isLoading }/>
</Address> */
}
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
</>
</>
)
}
)
}
...
...
ui/shared/AddressHeadingInfo.tsx
View file @
401f4962
...
@@ -8,10 +8,8 @@ import config from 'configs/app';
...
@@ -8,10 +8,8 @@ import config from 'configs/app';
import
AddressFavoriteButton
from
'
ui/address/details/AddressFavoriteButton
'
;
import
AddressFavoriteButton
from
'
ui/address/details/AddressFavoriteButton
'
;
import
AddressQrCode
from
'
ui/address/details/AddressQrCode
'
;
import
AddressQrCode
from
'
ui/address/details/AddressQrCode
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressActionsMenu
from
'
ui/shared/AddressActions/Menu
'
;
import
AddressActionsMenu
from
'
ui/shared/AddressActions/Menu
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
interface
Props
{
interface
Props
{
address
:
Pick
<
Address
,
'
hash
'
|
'
is_contract
'
|
'
implementation_name
'
|
'
watchlist_names
'
|
'
watchlist_address_id
'
>
;
address
:
Pick
<
Address
,
'
hash
'
|
'
is_contract
'
|
'
implementation_name
'
|
'
watchlist_names
'
|
'
watchlist_address_id
'
>
;
...
@@ -23,18 +21,14 @@ interface Props {
...
@@ -23,18 +21,14 @@ interface Props {
const
AddressHeadingInfo
=
({
address
,
token
,
isLinkDisabled
,
isLoading
}:
Props
)
=>
{
const
AddressHeadingInfo
=
({
address
,
token
,
isLinkDisabled
,
isLoading
}:
Props
)
=>
{
return
(
return
(
<
Flex
alignItems=
"center"
>
<
Flex
alignItems=
"center"
>
<
AddressIcon
address=
{
address
}
isLoading=
{
isLoading
}
/>
<
AddressEntity
<
AddressLink
address=
{
address
}
type=
"address"
isLoading=
{
isLoading
}
hash=
{
address
.
hash
}
ml=
{
2
}
fontFamily=
"heading"
fontFamily=
"heading"
fontSize=
"lg"
fontSize=
"lg"
fontWeight=
{
500
}
fontWeight=
{
500
}
isDisabled=
{
isLinkDisabled
}
noLink=
{
isLinkDisabled
}
isLoading=
{
isLoading
}
/>
/>
<
CopyToClipboard
text=
{
address
.
hash
}
isLoading=
{
isLoading
}
/>
{
!
isLoading
&&
address
.
is_contract
&&
token
&&
<
AddressAddToWallet
ml=
{
2
}
token=
{
token
}
/>
}
{
!
isLoading
&&
address
.
is_contract
&&
token
&&
<
AddressAddToWallet
ml=
{
2
}
token=
{
token
}
/>
}
{
!
isLoading
&&
!
address
.
is_contract
&&
config
.
features
.
account
.
isEnabled
&&
(
{
!
isLoading
&&
!
address
.
is_contract
&&
config
.
features
.
account
.
isEnabled
&&
(
<
AddressFavoriteButton
hash=
{
address
.
hash
}
watchListId=
{
address
.
watchlist_address_id
}
ml=
{
3
}
/>
<
AddressFavoriteButton
hash=
{
address
.
hash
}
watchListId=
{
address
.
watchlist_address_id
}
ml=
{
3
}
/>
...
...
ui/shared/entities/address/AddressEntityL1.tsx
0 → 100644
View file @
401f4962
import
{
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
config
from
'
configs/app
'
;
import
*
as
AddressEntity
from
'
./AddressEntity
'
;
const
feature
=
config
.
features
.
rollup
;
const
AddressEntityL1
=
(
props
:
AddressEntity
.
EntityProps
)
=>
{
if
(
!
feature
.
isEnabled
)
{
return
null
;
}
const
defaultHref
=
feature
.
L1BaseUrl
+
route
({
pathname
:
'
/address/[hash]
'
,
query
:
{
...
props
.
query
,
hash
:
props
.
address
.
hash
,
},
});
return
(
<
AddressEntity
.
default
{
...
props
}
href=
{
props
.
href
??
defaultHref
}
isExternal
/>
);
};
export
default
chakra
(
AddressEntityL1
);
ui/verifiedContracts/VerifiedContractsTableItem.tsx
View file @
401f4962
...
@@ -9,10 +9,9 @@ import iconCheck from 'icons/check.svg';
...
@@ -9,10 +9,9 @@ import iconCheck from 'icons/check.svg';
import
iconCross
from
'
icons/cross.svg
'
;
import
iconCross
from
'
icons/cross.svg
'
;
import
iconSuccess
from
'
icons/status/success.svg
'
;
import
iconSuccess
from
'
icons/status/success.svg
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
Icon
from
'
ui/shared/chakra/Icon
'
;
import
Icon
from
'
ui/shared/chakra/Icon
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
HashStringShorten
from
'
ui/shared/HashStringShorten
'
;
import
HashStringShorten
from
'
ui/shared/HashStringShorten
'
;
interface
Props
{
interface
Props
{
...
@@ -28,17 +27,18 @@ const VerifiedContractsTableItem = ({ data, isLoading }: Props) => {
...
@@ -28,17 +27,18 @@ const VerifiedContractsTableItem = ({ data, isLoading }: Props) => {
return
(
return
(
<
Tr
>
<
Tr
>
<
Td
>
<
Td
>
<
Flex
columnGap=
{
2
}
>
<
AddressEntity
<
AddressIcon
address=
{
data
.
address
}
isLoading=
{
isLoading
}
/>
address=
{
data
.
address
}
<
Flex
columnGap=
{
2
}
flexWrap=
"wrap"
w=
"calc(100% - 32px)"
>
isLoading=
{
isLoading
}
<
AddressLink
hash=
{
data
.
address
.
hash
}
type=
"address"
alias=
{
data
.
address
.
name
}
isLoading=
{
isLoading
}
my=
{
1
}
query=
{
{
tab
:
'
contract
'
}
}
/>
query=
{
{
tab
:
'
contract
'
}
}
<
Flex
alignItems=
"center"
>
noCopy
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_secondary"
my=
{
1
}
>
mt=
{
1
}
<
HashStringShorten
hash=
{
data
.
address
.
hash
}
isTooltipDisabled
/>
/>
</
Skeleton
>
<
Flex
alignItems=
"center"
ml=
{
7
}
>
<
CopyToClipboard
text=
{
data
.
address
.
hash
}
isLoading=
{
isLoading
}
/>
<
Skeleton
isLoaded=
{
!
isLoading
}
color=
"text_secondary"
my=
{
1
}
>
</
Flex
>
<
HashStringShorten
hash=
{
data
.
address
.
hash
}
isTooltipDisabled
/>
</
Flex
>
</
Skeleton
>
<
CopyToClipboard
text=
{
data
.
address
.
hash
}
isLoading=
{
isLoading
}
/>
</
Flex
>
</
Flex
>
</
Td
>
</
Td
>
<
Td
isNumeric
>
<
Td
isNumeric
>
...
...
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