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
9e3bc39e
Commit
9e3bc39e
authored
Apr 25, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
featured network icon invertion for dark mode
parent
daf2e08f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
26 deletions
+21
-26
.env.goerli
configs/envs/.env.goerli
+3
-3
.env.goerli.optimism
configs/envs/.env.goerli.optimism
+3
-3
.env.localhost
configs/envs/.env.localhost
+1
-1
.env.poa_core
configs/envs/.env.poa_core
+3
-3
networks.ts
types/networks.ts
+1
-0
NetworkMenuLink.tsx
ui/snippets/networkMenu/NetworkMenuLink.tsx
+9
-8
useColors.ts
ui/snippets/networkMenu/useColors.ts
+1
-8
No files found.
configs/envs/.env.goerli
View file @
9e3bc39e
# ui config
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/
main
/configs/featured-networks/eth-goerli.json
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/
dev
/configs/featured-networks/eth-goerli.json
NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Anyblock','baseUrl':'https://explorer.anyblock.tools','paths':{'tx':'/ethereum/ethereum/goerli/transaction','address':'/ethereum/ethereum/goerli/address'}},{'title':'Etherscan','baseUrl':'https://goerli.etherscan.io/','paths':{'tx':'/tx','address':'/address'}}]
NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0xf7d4972356e6ae44ae948d0cf19ef2beaf0e574c180997e969a2837da15e349d
...
...
@@ -7,8 +7,8 @@ NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0xf7d4972356e6ae44ae948d0cf19ef2beaf0e574c18099
NEXT_PUBLIC_NETWORK_NAME=Goerli
NEXT_PUBLIC_NETWORK_SHORT_NAME=Goerli
NEXT_PUBLIC_NETWORK_ASSETS_PATHNAME=ethereum
NEXT_PUBLIC_NETWORK_LOGO=https://raw.githubusercontent.com/blockscout/frontend-configs/
main
/configs/network-logos/goerli.svg
NEXT_PUBLIC_NETWORK_ICON=https://raw.githubusercontent.com/blockscout/frontend-configs/
main
/configs/network-icons/goerli.svg
NEXT_PUBLIC_NETWORK_LOGO=https://raw.githubusercontent.com/blockscout/frontend-configs/
dev
/configs/network-logos/goerli.svg
NEXT_PUBLIC_NETWORK_ICON=https://raw.githubusercontent.com/blockscout/frontend-configs/
dev
/configs/network-icons/goerli.svg
NEXT_PUBLIC_NETWORK_ID=5
NEXT_PUBLIC_NETWORK_CURRENCY_NAME=Ether
NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL=ETH
...
...
configs/envs/.env.goerli.optimism
View file @
9e3bc39e
# ui config
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/
main
/configs/featured-networks/base-goerli.json
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/
dev
/configs/featured-networks/base-goerli.json
NEXT_PUBLIC_NETWORK_EXPLORERS=
NEXT_PUBLIC_HOMEPAGE_PLATE_GRADIENT=linear-gradient(136.9deg,rgb(107 94 236) 1.5%,rgb(0 82 255) 56.84%,rgb(82 62 231) 98.54%)
NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0x4a0ed8ddf751a7cb5297f827699117b0f6d21a0b2907594d300dc9fed75c7e62
...
...
@@ -8,8 +8,8 @@ NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0x4a0ed8ddf751a7cb5297f827699117b0f6d21a0b29075
NEXT_PUBLIC_NETWORK_NAME=Base Göerli
NEXT_PUBLIC_NETWORK_SHORT_NAME=Base
NEXT_PUBLIC_NETWORK_ASSETS_PATHNAME=optimism
NEXT_PUBLIC_NETWORK_LOGO=https://raw.githubusercontent.com/blockscout/frontend-configs/
main
/configs/network-logos/base.svg
NEXT_PUBLIC_NETWORK_ICON=https://raw.githubusercontent.com/blockscout/frontend-configs/
main
/configs/network-icons/base.svg
NEXT_PUBLIC_NETWORK_LOGO=https://raw.githubusercontent.com/blockscout/frontend-configs/
dev
/configs/network-logos/base.svg
NEXT_PUBLIC_NETWORK_ICON=https://raw.githubusercontent.com/blockscout/frontend-configs/
dev
/configs/network-icons/base.svg
NEXT_PUBLIC_NETWORK_ID=420
NEXT_PUBLIC_NETWORK_CURRENCY_NAME=Ether
NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL=ETH
...
...
configs/envs/.env.localhost
View file @
9e3bc39e
...
...
@@ -11,7 +11,7 @@ NEXT_PUBLIC_FOOTER_TELEGRAM_LINK=https://t.me/poa_network
NEXT_PUBLIC_FOOTER_STAKING_LINK=https://duneanalytics.com/maxaleks/xdai-staking
NEXT_PUBLIC_FOOTER_GITHUB_LINK=https://github.com/blockscout/blockscout
NEXT_PUBLIC_FOOTER_TWITTER_LINK=https://www.twitter.com/blockscoutcom
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/
main
/configs/featured-networks/eth-goerli.json
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/
dev
/configs/featured-networks/eth-goerli.json
NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Anyblock','baseUrl':'https://explorer.anyblock.tools','paths':{'tx':'/ethereum/poa/core/transaction','address':'/ethereum/poa/core/address'}}]
NEXT_PUBLIC_HOMEPAGE_CHARTS=['daily_txs','coin_price','market_cup']
NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml
...
...
configs/envs/.env.poa_core
View file @
9e3bc39e
# ui config
NEXT_PUBLIC_FOOTER_TELEGRAM_LINK=https://t.me/poa_network
NEXT_PUBLIC_FOOTER_STAKING_LINK=https://duneanalytics.com/maxaleks/xdai-staking
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/
main
/configs/featured-networks/eth-goerli.json
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/
dev
/configs/featured-networks/eth-goerli.json
NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Anyblock','baseUrl':'https://explorer.anyblock.tools','paths':{'tx':'/ethereum/poa/core/transaction','address':'/ethereum/poa/core/address'}}]
NEXT_PUBLIC_HOMEPAGE_CHARTS=['daily_txs','coin_price','market_cup']
#NEXT_PUBLIC_HOMEPAGE_PLATE_GRADIENT='linear-gradient(136.9deg, #235643 1.5%, #16191E 77.77%)'
#NEXT_PUBLIC_HOMEPAGE_PLATE_TEXT_COLOR='#DCFE76'
NEXT_PUBLIC_NETWORK_LOGO=https://raw.githubusercontent.com/blockscout/frontend-configs/
main
/configs/network-logos/poa.svg
NEXT_PUBLIC_NETWORK_ICON=https://raw.githubusercontent.com/blockscout/frontend-configs/
main
/configs/network-icons/poa.svg
NEXT_PUBLIC_NETWORK_LOGO=https://raw.githubusercontent.com/blockscout/frontend-configs/
dev
/configs/network-logos/poa.svg
NEXT_PUBLIC_NETWORK_ICON=https://raw.githubusercontent.com/blockscout/frontend-configs/
dev
/configs/network-icons/poa.svg
# network config
NEXT_PUBLIC_NETWORK_NAME=POA
...
...
types/networks.ts
View file @
9e3bc39e
...
...
@@ -6,6 +6,7 @@ export interface FeaturedNetwork {
group
:
NetworkGroup
;
icon
?:
string
;
isActive
?:
boolean
;
invertIconInDarkMode
?:
boolean
;
}
export
interface
NetworkExplorer
{
...
...
ui/snippets/networkMenu/NetworkMenuLink.tsx
View file @
9e3bc39e
import
{
Box
,
Flex
,
Icon
,
Text
,
Image
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Flex
,
Icon
,
Text
,
Image
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
FeaturedNetwork
}
from
'
types/networks
'
;
...
...
@@ -13,17 +13,18 @@ interface Props extends FeaturedNetwork {
isMobile
?:
boolean
;
}
const
NetworkMenuLink
=
({
title
,
icon
,
isActive
,
isMobile
,
url
}:
Props
)
=>
{
const
hasIcon
=
Boolean
(
icon
);
const
colors
=
useColors
({
hasIcon
});
const
NetworkMenuLink
=
({
title
,
icon
,
isActive
,
isMobile
,
url
,
invertIconInDarkMode
}:
Props
)
=>
{
const
colors
=
useColors
();
const
darkModeFilter
=
{
filter
:
'
brightness(0) invert(1)
'
};
const
style
=
useColorModeValue
({},
invertIconInDarkMode
?
darkModeFilter
:
{});
const
iconEl
=
typeof
icon
===
'
string
'
?
(
<
Image
w=
"30px"
h=
"30px"
src=
{
icon
}
alt=
{
`${ title } network icon`
}
/>
const
iconEl
=
icon
?
(
<
Image
w=
"30px"
h=
"30px"
src=
{
icon
}
alt=
{
`${ title } network icon`
}
style=
{
style
}
/>
)
:
(
<
Icon
as=
{
hasIcon
?
icon
:
placeholderIcon
}
as=
{
placeholderIcon
}
boxSize=
"30px"
color=
{
isActive
?
colors
.
icon
.
active
:
colors
.
icon
.
default
}
color=
"blue.600"
/>
);
...
...
ui/snippets/networkMenu/useColors.ts
View file @
9e3bc39e
import
{
useColorModeValue
}
from
'
@chakra-ui/react
'
;
export
default
function
useColors
({
hasIcon
}:
{
hasIcon
:
boolean
})
{
const
iconDefaultColor
=
useColorModeValue
(
'
blackAlpha.600
'
,
'
whiteAlpha.600
'
);
const
iconPlaceholderDefaultColor
=
useColorModeValue
(
'
blackAlpha.100
'
,
'
whiteAlpha.100
'
);
export
default
function
useColors
()
{
return
{
text
:
{
'
default
'
:
useColorModeValue
(
'
gray.600
'
,
'
gray.400
'
),
active
:
useColorModeValue
(
'
blackAlpha.900
'
,
'
whiteAlpha.900
'
),
hover
:
useColorModeValue
(
'
blue.600
'
,
'
link_hovered
'
),
},
icon
:
{
'
default
'
:
hasIcon
?
iconDefaultColor
:
iconPlaceholderDefaultColor
,
active
:
useColorModeValue
(
'
blackAlpha.900
'
,
'
whiteAlpha.900
'
),
},
bg
:
{
'
default
'
:
'
transparent
'
,
active
:
useColorModeValue
(
'
blue.50
'
,
'
gray.800
'
),
...
...
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