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
bff7f8c0
Commit
bff7f8c0
authored
Jan 29, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explorers links design fixes
parent
c1961346
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
54 additions
and
11 deletions
+54
-11
.env.eth
configs/envs/.env.eth
+1
-1
schema.ts
deploy/tools/envs-validator/schema.ts
+1
-0
values.yaml.gotmpl
deploy/values/review/values.yaml.gotmpl
+1
-1
ENVS.md
docs/ENVS.md
+1
-0
networks.ts
types/networks.ts
+1
-0
NetworkExplorers.pw.tsx
ui/shared/NetworkExplorers.pw.tsx
+18
-0
NetworkExplorers.tsx
ui/shared/NetworkExplorers.tsx
+31
-9
NetworkExplorers.pw.tsx_default_base-view-1.png
...enshots__/NetworkExplorers.pw.tsx_default_base-view-1.png
+0
-0
No files found.
configs/envs/.env.eth
View file @
bff7f8c0
...
@@ -29,7 +29,7 @@ NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/front
...
@@ -29,7 +29,7 @@ NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/front
##views
##views
NEXT_PUBLIC_VIEWS_NFT_MARKETPLACES=[{'name':'OpenSea','collection_url':'https://opensea.io/assets/ethereum/{hash}','instance_url':'https://opensea.io/assets/ethereum/{hash}/{id}','logo_url':'https://opensea.io/static/images/logos/opensea-logo.svg'},{'name':'LooksRare','collection_url':'https://looksrare.org/collections/{hash}','instance_url':'https://looksrare.org/collections/{hash}/{id}','logo_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/nft-marketplace-logos/looks-rare.png'}]
NEXT_PUBLIC_VIEWS_NFT_MARKETPLACES=[{'name':'OpenSea','collection_url':'https://opensea.io/assets/ethereum/{hash}','instance_url':'https://opensea.io/assets/ethereum/{hash}/{id}','logo_url':'https://opensea.io/static/images/logos/opensea-logo.svg'},{'name':'LooksRare','collection_url':'https://looksrare.org/collections/{hash}','instance_url':'https://looksrare.org/collections/{hash}/{id}','logo_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/nft-marketplace-logos/looks-rare.png'}]
## misc
## misc
NEXT_PUBLIC_NETWORK_EXPLORERS=
[{'title':'Etherscan','baseUrl':'https://etherscan.io/','paths':{'tx':'/tx','address':'/address','token':'/token','block':'/block'}}]
NEXT_PUBLIC_NETWORK_EXPLORERS=
"[{'title':'Etherscan','logo':'https://github.com/blockscout/frontend-configs/blob/main/configs/explorer-logos/etherscan.png?raw=true','baseUrl':'https://etherscan.io/','paths':{'tx':'/tx','address':'/address','token':'/token','block':'/block'}}, {'title':'Blockchair','logo':'https://github.com/blockscout/frontend-configs/blob/main/configs/explorer-logos/blockchair.png?raw=true','baseUrl':'https://blockchair.com/','paths':{'tx':'/ethereum/transaction','address':'/ethereum/address','token':'/ethereum/erc-20/token','block':'/ethereum/block'}},{'title':'Sentio','logo':'https://github.com/blockscout/frontend-configs/blob/main/configs/explorer-logos/sentio.png?raw=true','baseUrl':'https://app.sentio.xyz/','paths':{'tx':'/tx/1','address':'/contract/1'}}, {'title':'Tenderly','logo':'https://github.com/blockscout/frontend-configs/blob/main/configs/explorer-logos/tenderly.png?raw=true','baseUrl':'https://dashboard.tenderly.co','paths':{'tx':'/tx/mainnet'}}, {'title':'0xPPL','logo':'https://github.com/blockscout/frontend-configs/blob/main/configs/explorer-logos/0xPPl.png?raw=true','baseUrl':'https://0xppl.com','paths':{'tx':'/Ethereum/tx','address':'/','token':'/c/Ethereum'}}, {'title':'3xpl','logo':'https://github.com/blockscout/frontend-configs/blob/main/configs/explorer-logos/3xpl.png?raw=true','baseUrl':'https://3xpl.com/','paths':{'tx':'/ethereum/transaction','address':'/ethereum/address'}} ]"
# app features
# app features
NEXT_PUBLIC_APP_ENV=development
NEXT_PUBLIC_APP_ENV=development
...
...
deploy/tools/envs-validator/schema.ts
View file @
bff7f8c0
...
@@ -252,6 +252,7 @@ const footerLinkGroupSchema: yup.ObjectSchema<CustomLinksGroup> = yup
...
@@ -252,6 +252,7 @@ const footerLinkGroupSchema: yup.ObjectSchema<CustomLinksGroup> = yup
const
networkExplorerSchema
:
yup
.
ObjectSchema
<
NetworkExplorer
>
=
yup
const
networkExplorerSchema
:
yup
.
ObjectSchema
<
NetworkExplorer
>
=
yup
.
object
({
.
object
({
title
:
yup
.
string
().
required
(),
title
:
yup
.
string
().
required
(),
logo
:
yup
.
string
().
test
(
urlTest
),
baseUrl
:
yup
.
string
().
test
(
urlTest
).
required
(),
baseUrl
:
yup
.
string
().
test
(
urlTest
).
required
(),
paths
:
yup
paths
:
yup
.
object
()
.
object
()
...
...
deploy/values/review/values.yaml.gotmpl
View file @
bff7f8c0
...
@@ -62,7 +62,7 @@ frontend:
...
@@ -62,7 +62,7 @@ frontend:
NEXT_PUBLIC_LOGOUT_URL: https://blockscoutcom.us.auth0.com/v2/logout
NEXT_PUBLIC_LOGOUT_URL: https://blockscoutcom.us.auth0.com/v2/logout
NEXT_PUBLIC_HOMEPAGE_CHARTS: "['daily_txs','coin_price','market_cap']"
NEXT_PUBLIC_HOMEPAGE_CHARTS: "['daily_txs','coin_price','market_cap']"
NEXT_PUBLIC_NETWORK_RPC_URL: https://rpc.ankr.com/eth_goerli
NEXT_PUBLIC_NETWORK_RPC_URL: https://rpc.ankr.com/eth_goerli
NEXT_PUBLIC_NETWORK_EXPLORERS: "[{'title':'Bitquery','baseUrl':'https://explorer.bitquery.io/','paths':{'tx':'/goerli/tx','address':'/goerli/address','token':'/goerli/token','block':'/goerli/block'}},{'title':'Etherscan','baseUrl':'https://goerli.etherscan.io/','paths':{'tx':'/tx','address':'/address','token':'/token','block':'/block'}}]"
NEXT_PUBLIC_NETWORK_EXPLORERS: "[{'title':'Bitquery','baseUrl':'https://explorer.bitquery.io/','paths':{'tx':'/goerli/tx','address':'/goerli/address','token':'/goerli/token','block':'/goerli/block'}},{'title':'Etherscan','
logo':'https://github.com/blockscout/frontend-configs/blob/main/configs/explorer-logos/etherscan.png?raw=true','
baseUrl':'https://goerli.etherscan.io/','paths':{'tx':'/tx','address':'/address','token':'/token','block':'/block'}}]"
NEXT_PUBLIC_MARKETPLACE_CONFIG_URL: https://raw.githubusercontent.com/blockscout/frontend-configs/dev/configs/marketplace/eth-goerli.json
NEXT_PUBLIC_MARKETPLACE_CONFIG_URL: https://raw.githubusercontent.com/blockscout/frontend-configs/dev/configs/marketplace/eth-goerli.json
NEXT_PUBLIC_GRAPHIQL_TRANSACTION: 0xf7d4972356e6ae44ae948d0cf19ef2beaf0e574c180997e969a2837da15e349d
NEXT_PUBLIC_GRAPHIQL_TRANSACTION: 0xf7d4972356e6ae44ae948d0cf19ef2beaf0e574c180997e969a2837da15e349d
NEXT_PUBLIC_WEB3_WALLETS: "['token_pocket','coinbase','metamask']"
NEXT_PUBLIC_WEB3_WALLETS: "['token_pocket','coinbase','metamask']"
...
...
docs/ENVS.md
View file @
bff7f8c0
...
@@ -268,6 +268,7 @@ Settings for meta tags and OG tags
...
@@ -268,6 +268,7 @@ Settings for meta tags and OG tags
| Variable | Type| Description | Compulsoriness | Default value | Example value |
| Variable | Type| Description | Compulsoriness | Default value | Example value |
| --- | --- | --- | --- | --- | --- |
| --- | --- | --- | --- | --- | --- |
| logo |
`string`
| URL to explorer logo file. Should be at least 40x40. | - | - |
`'https://foo.app/icon.png'`
|
| title |
`string`
| Displayed name of the explorer | Required | - |
`Anyblock`
|
| title |
`string`
| Displayed name of the explorer | Required | - |
`Anyblock`
|
| baseUrl |
`string`
| Base url of the explorer | Required | - |
`https://explorer.anyblock.tools`
|
| baseUrl |
`string`
| Base url of the explorer | Required | - |
`https://explorer.anyblock.tools`
|
| paths |
`Record<'tx' \| 'block' \| 'address' \| 'token', string>`
| Map of explorer entities and their paths | Required | - |
`{'tx':'/ethereum/poa/core/tx'}`
|
| paths |
`Record<'tx' \| 'block' \| 'address' \| 'token', string>`
| Map of explorer entities and their paths | Required | - |
`{'tx':'/ethereum/poa/core/tx'}`
|
...
...
types/networks.ts
View file @
bff7f8c0
...
@@ -13,6 +13,7 @@ export interface FeaturedNetwork {
...
@@ -13,6 +13,7 @@ export interface FeaturedNetwork {
}
}
export
interface
NetworkExplorer
{
export
interface
NetworkExplorer
{
logo
?:
string
;
title
:
string
;
title
:
string
;
baseUrl
:
string
;
baseUrl
:
string
;
paths
:
{
paths
:
{
...
...
ui/shared/NetworkExplorers.pw.tsx
0 → 100644
View file @
bff7f8c0
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
NetworkExplorers
from
'
./NetworkExplorers
'
;
test
(
'
base view
'
,
async
({
mount
,
page
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
NetworkExplorers
type=
"tx"
pathParam=
"0x123"
/>
</
TestApp
>,
);
await
component
.
getByText
(
'
2
'
).
click
();
await
expect
(
page
).
toHaveScreenshot
({
clip
:
{
x
:
0
,
y
:
0
,
width
:
300
,
height
:
150
}
});
});
ui/shared/NetworkExplorers.tsx
View file @
bff7f8c0
import
{
Flex
,
Button
,
chakra
,
Popover
,
PopoverTrigger
,
PopoverBody
,
PopoverContent
,
useDisclosure
,
Show
,
Hide
}
from
'
@chakra-ui/react
'
;
import
{
Image
,
Button
,
Popover
,
PopoverTrigger
,
PopoverBody
,
PopoverContent
,
Show
,
Hide
,
useColorModeValue
,
chakra
,
useDisclosure
,
Grid
,
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
NetworkExplorer
as
TNetworkExplorer
}
from
'
types/networks
'
;
import
type
{
NetworkExplorer
as
TNetworkExplorer
}
from
'
types/networks
'
;
...
@@ -16,15 +29,24 @@ interface Props {
...
@@ -16,15 +29,24 @@ interface Props {
const
NetworkExplorers
=
({
className
,
type
,
pathParam
}:
Props
)
=>
{
const
NetworkExplorers
=
({
className
,
type
,
pathParam
}:
Props
)
=>
{
const
{
isOpen
,
onToggle
,
onClose
}
=
useDisclosure
();
const
{
isOpen
,
onToggle
,
onClose
}
=
useDisclosure
();
const
defaultIconColor
=
useColorModeValue
(
'
gray.400
'
,
'
gray.500
'
);
const
explorersLinks
=
React
.
useMemo
(()
=>
{
const
explorersLinks
=
React
.
useMemo
(()
=>
{
return
config
.
UI
.
explorers
.
items
return
config
.
UI
.
explorers
.
items
.
filter
((
explorer
)
=>
typeof
explorer
.
paths
[
type
]
===
'
string
'
)
.
filter
((
explorer
)
=>
typeof
explorer
.
paths
[
type
]
===
'
string
'
)
.
map
((
explorer
)
=>
{
.
map
((
explorer
)
=>
{
const
url
=
new
URL
(
stripTrailingSlash
(
explorer
.
paths
[
type
]
||
''
)
+
'
/
'
+
pathParam
,
explorer
.
baseUrl
);
const
url
=
new
URL
(
stripTrailingSlash
(
explorer
.
paths
[
type
]
||
''
)
+
'
/
'
+
pathParam
,
explorer
.
baseUrl
);
return
<
LinkExternal
key=
{
explorer
.
baseUrl
}
href=
{
url
.
toString
()
}
>
{
explorer
.
title
}
</
LinkExternal
>;
return
(
<
LinkExternal
h=
"34px"
key=
{
explorer
.
baseUrl
}
href=
{
url
.
toString
()
}
alignItems=
"center"
display=
"inline-flex"
minW=
"120px"
>
{
explorer
.
logo
?
<
Image
boxSize=
{
5
}
mr=
{
2
}
src=
{
explorer
.
logo
}
alt=
{
`${ explorer.title } icon`
}
/>
:
<
IconSvg
name=
"explorer"
boxSize=
{
5
}
color=
{
defaultIconColor
}
mr=
{
2
}
/>
}
{
explorer
.
title
}
</
LinkExternal
>
);
});
});
},
[
pathParam
,
type
]);
},
[
pathParam
,
type
,
defaultIconColor
]);
if
(
explorersLinks
.
length
===
0
)
{
if
(
explorersLinks
.
length
===
0
)
{
return
null
;
return
null
;
...
@@ -54,18 +76,18 @@ const NetworkExplorers = ({ className, type, pathParam }: Props) => {
...
@@ -54,18 +76,18 @@ const NetworkExplorers = ({ className, type, pathParam }: Props) => {
</
Hide
>
</
Hide
>
</
Button
>
</
Button
>
</
PopoverTrigger
>
</
PopoverTrigger
>
<
PopoverContent
w=
"
240px
"
>
<
PopoverContent
w=
"
auto
"
>
<
PopoverBody
>
<
PopoverBody
>
<
chakra
.
span
color=
"text_secondary"
fontSize=
"xs"
>
Verify with other explorers
</
chakra
.
span
>
<
chakra
.
span
color=
"text_secondary"
fontSize=
"xs"
>
Verify with other explorers
</
chakra
.
span
>
<
Flex
<
Grid
alignItems=
"center"
alignItems=
"center"
flexWrap=
"wrap"
templateColumns=
{
explorersLinks
.
length
>
1
?
'
auto auto
'
:
'
1fr
'
}
columnGap=
{
6
}
columnGap=
{
4
}
rowGap=
{
3
}
rowGap=
{
2
}
mt=
{
3
}
mt=
{
3
}
>
>
{
explorersLinks
}
{
explorersLinks
}
</
Flex
>
</
Grid
>
</
PopoverBody
>
</
PopoverBody
>
</
PopoverContent
>
</
PopoverContent
>
</
Popover
>
</
Popover
>
...
...
ui/shared/__screenshots__/NetworkExplorers.pw.tsx_default_base-view-1.png
0 → 100644
View file @
bff7f8c0
8.12 KB
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