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
aa89fc9a
Commit
aa89fc9a
authored
Aug 24, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
envs for footer links and networks
parent
634353aa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
112 additions
and
92 deletions
+112
-92
.env.example
.env.example
+7
-1
networks.ts
lib/networks.ts
+94
-82
networks.ts
types/networks.ts
+0
-1
NavFooter.tsx
ui/navigation/NavFooter.tsx
+9
-6
NetworkMenuLink.tsx
ui/navigation/networkMenu/NetworkMenuLink.tsx
+2
-2
No files found.
.env.example
View file @
aa89fc9a
API_AUTHORIZATION_TOKEN=xxx
API_AUTHORIZATION_TOKEN=xxx
\ No newline at end of file
NEXT_PUBLIC_BLOCKSCOUT_VERSION=xxx
NEXT_PUBLIC_FOOTER_GITHUB_LINK=https://github.com/blockscout/blockscout
NEXT_PUBLIC_FOOTER_TWITTER_LINK=https://www.twitter.com/blockscoutcom
NEXT_PUBLIC_FOOTER_TELEGRAM_LINK=https://t.me/poa_network
NEXT_PUBLIC_FOOTER_ANALYTICS_LINK=https://duneanalytics.com/maxaleks/xdai-staking
NEXT_PUBLIC_SUPPORTED_NETWORKS=[{"name":"Gnosis Chain","type":"xdai","subType":"mainnet","group":"mainnets","isAccountSupported":true},{"name":"Optimism on Gnosis Chain","type":"xdai","subType":"optimism","group":"mainnets"},{"name":"Arbitrum on xDai","type":"xdai","subType":"aox","group":"mainnets"},{"name":"Ethereum","type":"eth","subType":"mainnet","group":"mainnets"},{"name":"Ethereum Classic","type":"etc","subType":"mainnet","group":"mainnets"},{"name":"POA","type":"poa","subType":"core","group":"mainnets"},{"name":"RSK","type":"rsk","subType":"mainnet","group":"mainnets"},{"name":"Gnosis Chain Testnet","type":"xdai","subType":"testnet","group":"testnets","isAccountSupported":true},{"name":"POA Sokol","type":"poa","subType":"sokol","group":"testnets"},{"name":"ARTIS Σ1","type":"artis","subType":"sigma1","group":"other"},{"name":"LUKSO L14","type":"lukso","subType":"l14","group":"other"}]
\ No newline at end of file
lib/networks.ts
View file @
aa89fc9a
...
@@ -10,88 +10,100 @@ import poaSokolIcon from 'icons/networks/poa-sokol.svg';
...
@@ -10,88 +10,100 @@ import poaSokolIcon from 'icons/networks/poa-sokol.svg';
import
poaIcon
from
'
icons/networks/poa.svg
'
;
import
poaIcon
from
'
icons/networks/poa.svg
'
;
import
rskIcon
from
'
icons/networks/rsk.svg
'
;
import
rskIcon
from
'
icons/networks/rsk.svg
'
;
export
const
NETWORKS
:
Array
<
Network
>
=
[
// will change later when we agree how to host network icons
{
const
ICONS
:
Record
<
string
,
React
.
FunctionComponent
<
React
.
SVGAttributes
<
SVGElement
>>>
=
{
name
:
'
Gnosis Chain
'
,
'
xdai/mainnet
'
:
gnosisIcon
,
type
:
'
xdai
'
,
'
xdai/optimism
'
:
optimismIcon
,
subType
:
'
mainnet
'
,
'
xdai/aox
'
:
arbitrumIcon
,
icon
:
gnosisIcon
,
'
eth/mainnet
'
:
ethereumIcon
,
group
:
'
mainnets
'
,
'
etc/mainnet
'
:
ethereumClassicIcon
,
isAccountSupported
:
true
,
'
poa/core
'
:
poaIcon
,
isNewUiSupported
:
true
,
'
rsk/mainnet
'
:
rskIcon
,
},
'
xdai/testnet
'
:
arbitrumIcon
,
{
'
poa/sokol
'
:
poaSokolIcon
,
name
:
'
Optimism on Gnosis Chain
'
,
'
artis/sigma1
'
:
artisIcon
,
type
:
'
xdai
'
,
};
subType
:
'
optimism
'
,
icon
:
optimismIcon
,
export
const
NETWORKS
:
Array
<
Network
>
=
(()
=>
{
group
:
'
mainnets
'
,
try
{
},
const
networksFromConfig
:
Array
<
Network
>
=
JSON
.
parse
(
process
.
env
.
NEXT_PUBLIC_SUPPORTED_NETWORKS
||
'
[]
'
);
{
return
networksFromConfig
.
map
((
network
)
=>
({
...
network
,
icon
:
ICONS
[
`
${
network
.
type
}
/
${
network
.
subType
}
`
]
}));
name
:
'
Arbitrum on xDai
'
,
}
catch
(
error
)
{
type
:
'
xdai
'
,
return
[];
subType
:
'
aox
'
,
}
icon
:
arbitrumIcon
,
})();
group
:
'
mainnets
'
,
},
// for easy env creation
{
// const FOR_CONFIG = [
name
:
'
Ethereum
'
,
// {
type
:
'
eth
'
,
// name: 'Gnosis Chain',
subType
:
'
mainnet
'
,
// type: 'xdai',
icon
:
ethereumIcon
,
// subType: 'mainnet',
group
:
'
mainnets
'
,
// group: 'mainnets',
},
// isAccountSupported: true,
{
// },
name
:
'
Ethereum Classic
'
,
// {
type
:
'
etc
'
,
// name: 'Optimism on Gnosis Chain',
subType
:
'
mainnet
'
,
// type: 'xdai',
icon
:
ethereumClassicIcon
,
// subType: 'optimism',
group
:
'
mainnets
'
,
// group: 'mainnets',
},
// },
{
// {
name
:
'
POA
'
,
// name: 'Arbitrum on xDai',
type
:
'
poa
'
,
// type: 'xdai',
subType
:
'
core
'
,
// subType: 'aox',
icon
:
poaIcon
,
// group: 'mainnets',
group
:
'
mainnets
'
,
// },
},
// {
{
// name: 'Ethereum',
name
:
'
RSK
'
,
// type: 'eth',
type
:
'
rsk
'
,
// subType: 'mainnet',
subType
:
'
mainnet
'
,
// group: 'mainnets',
icon
:
rskIcon
,
// },
group
:
'
mainnets
'
,
// {
},
// name: 'Ethereum Classic',
{
// type: 'etc',
name
:
'
Gnosis Chain Testnet
'
,
// subType: 'mainnet',
type
:
'
xdai
'
,
// group: 'mainnets',
subType
:
'
testnet
'
,
// },
icon
:
arbitrumIcon
,
// {
group
:
'
testnets
'
,
// name: 'POA',
isAccountSupported
:
true
,
// type: 'poa',
isNewUiSupported
:
true
,
// subType: 'core',
},
// group: 'mainnets',
{
// },
name
:
'
POA Sokol
'
,
// {
type
:
'
poa
'
,
// name: 'RSK',
subType
:
'
sokol
'
,
// type: 'rsk',
icon
:
poaSokolIcon
,
// subType: 'mainnet',
group
:
'
testnets
'
,
// group: 'mainnets',
},
// },
{
// {
name
:
'
ARTIS Σ1
'
,
// name: 'Gnosis Chain Testnet',
type
:
'
artis
'
,
// type: 'xdai',
subType
:
'
sigma1
'
,
// subType: 'testnet',
icon
:
artisIcon
,
// group: 'testnets',
group
:
'
other
'
,
// isAccountSupported: true,
},
// },
{
// {
name
:
'
LUKSO L14
'
,
// name: 'POA Sokol',
type
:
'
lukso
'
,
// type: 'poa',
subType
:
'
l14
'
,
// subType: 'sokol',
group
:
'
other
'
,
// group: 'testnets',
},
// },
];
// {
// name: 'ARTIS Σ1',
// type: 'artis',
// subType: 'sigma1',
// group: 'other',
// },
// {
// name: 'LUKSO L14',
// type: 'lukso',
// subType: 'l14',
// group: 'other',
// },
// ];
export
const
ACCOUNT_ROUTES
=
[
'
/watchlist
'
,
'
/private-tags
'
,
'
/public-tags
'
,
'
/api-keys
'
,
'
/custom-abi
'
];
export
const
ACCOUNT_ROUTES
=
[
'
/watchlist
'
,
'
/private-tags
'
,
'
/public-tags
'
,
'
/api-keys
'
,
'
/custom-abi
'
];
...
...
types/networks.ts
View file @
aa89fc9a
...
@@ -10,5 +10,4 @@ export interface Network {
...
@@ -10,5 +10,4 @@ export interface Network {
group
:
'
mainnets
'
|
'
testnets
'
|
'
other
'
;
group
:
'
mainnets
'
|
'
testnets
'
|
'
other
'
;
icon
?:
FunctionComponent
<
SVGAttributes
<
SVGElement
>>
;
icon
?:
FunctionComponent
<
SVGAttributes
<
SVGElement
>>
;
isAccountSupported
?:
boolean
;
isAccountSupported
?:
boolean
;
isNewUiSupported
?:
boolean
;
}
}
ui/navigation/NavFooter.tsx
View file @
aa89fc9a
...
@@ -8,11 +8,14 @@ import twIcon from 'icons/social/tweet.svg';
...
@@ -8,11 +8,14 @@ import twIcon from 'icons/social/tweet.svg';
import
getDefaultTransitionProps
from
'
theme/utils/getDefaultTransitionProps
'
;
import
getDefaultTransitionProps
from
'
theme/utils/getDefaultTransitionProps
'
;
const
SOCIAL_LINKS
=
[
const
SOCIAL_LINKS
=
[
{
link
:
'
#gh
'
,
icon
:
ghIcon
},
{
link
:
process
.
env
.
NEXT_PUBLIC_FOOTER_GITHUB_LINK
,
icon
:
ghIcon
},
{
link
:
'
#tw
'
,
icon
:
twIcon
},
{
link
:
process
.
env
.
NEXT_PUBLIC_FOOTER_TWITTER_LINK
,
icon
:
twIcon
},
{
link
:
'
#tg
'
,
icon
:
tgIcon
},
{
link
:
process
.
env
.
NEXT_PUBLIC_FOOTER_TELEGRAM_LINK
,
icon
:
tgIcon
},
{
link
:
'
#stats
'
,
icon
:
statsIcon
},
{
link
:
process
.
env
.
NEXT_PUBLIC_FOOTER_ANALYTICS_LINK
,
icon
:
statsIcon
},
];
].
filter
(({
link
})
=>
link
!==
undefined
);
const
BLOCKSCOUT_VERSION
=
process
.
env
.
NEXT_PUBLIC_BLOCKSCOUT_VERSION
;
const
VERSION_URL
=
`https://github.com/blockscout/blockscout/tree/
${
BLOCKSCOUT_VERSION
}
`
;
interface
Props
{
interface
Props
{
isCollapsed
:
boolean
;
isCollapsed
:
boolean
;
...
@@ -47,7 +50,7 @@ const NavFooter = ({ isCollapsed }: Props) => {
...
@@ -47,7 +50,7 @@ const NavFooter = ({ isCollapsed }: Props) => {
<
Text
variant=
"secondary"
>
<
Text
variant=
"secondary"
>
Blockscout is a tool for inspecting and analyzing EVM based blockchains. Blockchain explorer for Ethereum Networks.
Blockscout is a tool for inspecting and analyzing EVM based blockchains. Blockchain explorer for Ethereum Networks.
</
Text
>
</
Text
>
<
Text
variant=
"secondary"
>
Version:
<
Link
>
v4.2.1-beta
</
Link
></
Text
>
<
Text
variant=
"secondary"
>
Version:
<
Link
href=
{
VERSION_URL
}
target=
"_blank"
>
{
BLOCKSCOUT_VERSION
}
</
Link
></
Text
>
</>
</>
)
}
)
}
</
VStack
>
</
VStack
>
...
...
ui/navigation/networkMenu/NetworkMenuLink.tsx
View file @
aa89fc9a
...
@@ -15,7 +15,7 @@ interface Props extends Network {
...
@@ -15,7 +15,7 @@ interface Props extends Network {
routeName
:
string
;
routeName
:
string
;
}
}
const
NetworkMenuLink
=
({
name
,
type
,
subType
,
icon
,
isActive
,
routeName
,
isAccountSupported
,
isNewUiSupported
}:
Props
)
=>
{
const
NetworkMenuLink
=
({
name
,
type
,
subType
,
icon
,
isActive
,
routeName
,
isAccountSupported
}:
Props
)
=>
{
const
isAccount
=
isAccountRoute
(
routeName
);
const
isAccount
=
isAccountRoute
(
routeName
);
const
localPath
=
(()
=>
{
const
localPath
=
(()
=>
{
if
(
isAccount
&&
isAccountSupported
)
{
if
(
isAccount
&&
isAccountSupported
)
{
...
@@ -32,7 +32,7 @@ const NetworkMenuLink = ({ name, type, subType, icon, isActive, routeName, isAcc
...
@@ -32,7 +32,7 @@ const NetworkMenuLink = ({ name, type, subType, icon, isActive, routeName, isAcc
const
pathName
=
`/
${
type
}
/
${
subType
}${
localPath
}
`
;
const
pathName
=
`/
${
type
}
/
${
subType
}${
localPath
}
`
;
// will fix later after we agree on CI/CD workflow
// will fix later after we agree on CI/CD workflow
const
href
=
isNewUiSupported
?
pathName
:
'
https://blockscout.com
'
+
pathName
;
const
href
=
type
===
'
xdai
'
?
pathName
:
'
https://blockscout.com
'
+
pathName
;
const
hasIcon
=
Boolean
(
icon
);
const
hasIcon
=
Boolean
(
icon
);
const
colors
=
useColors
({
hasIcon
});
const
colors
=
useColors
({
hasIcon
});
...
...
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