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
5ab4a08b
Commit
5ab4a08b
authored
Dec 08, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small logo fix
parent
ef39230b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
45 deletions
+58
-45
.env.poa_core
configs/envs/.env.poa_core
+1
-0
NavigationDesktop.tsx
ui/snippets/navigation/NavigationDesktop.tsx
+3
-1
NetworkLogo.tsx
ui/snippets/networkMenu/NetworkLogo.tsx
+54
-44
No files found.
configs/envs/.env.poa_core
View file @
5ab4a08b
...
@@ -5,6 +5,7 @@ NEXT_PUBLIC_FEATURED_NETWORKS=[{'title':'Gnosis Chain','url':'https://blockscout
...
@@ -5,6 +5,7 @@ NEXT_PUBLIC_FEATURED_NETWORKS=[{'title':'Gnosis Chain','url':'https://blockscout
NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Anyblock','baseUrl':'https://explorer.anyblock.tools','paths':{'tx':'/ethereum/poa/core/transaction','address':'/ethereum/poa/core/address'}}]
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_CHARTS=['daily_txs','coin_price','market_cup']
NEXT_PUBLIC_HOMEPAGE_PLATE_GRADIENT=radial-gradient(at 12% 37%, hsla(324,73%,67%,1) 0px, transparent 50%), radial-gradient(at 62% 14%, hsla(256,87%,73%,1) 0px, transparent 50%), radial-gradient(at 84% 80%, hsla(128,75%,73%,1) 0px, transparent 50%), radial-gradient(at 57% 46%, hsla(285,63%,72%,1) 0px, transparent 50%), radial-gradient(at 37% 30%, hsla(174,70%,61%,1) 0px, transparent 50%), radial-gradient(at 15% 86%, hsla(350,65%,70%,1) 0px, transparent 50%), radial-gradient(at 67% 57%, hsla(14,95%,76%,1) 0px, transparent 50%)
NEXT_PUBLIC_HOMEPAGE_PLATE_GRADIENT=radial-gradient(at 12% 37%, hsla(324,73%,67%,1) 0px, transparent 50%), radial-gradient(at 62% 14%, hsla(256,87%,73%,1) 0px, transparent 50%), radial-gradient(at 84% 80%, hsla(128,75%,73%,1) 0px, transparent 50%), radial-gradient(at 57% 46%, hsla(285,63%,72%,1) 0px, transparent 50%), radial-gradient(at 37% 30%, hsla(174,70%,61%,1) 0px, transparent 50%), radial-gradient(at 15% 86%, hsla(350,65%,70%,1) 0px, transparent 50%), radial-gradient(at 67% 57%, hsla(14,95%,76%,1) 0px, transparent 50%)
#NEXT_PUBLIC_NETWORK_LOGO=https://placekitten.com/300/60
#NEXT_PUBLIC_NETWORK_SMALL_LOGO=https://placekitten.com/300/300
#NEXT_PUBLIC_NETWORK_SMALL_LOGO=https://placekitten.com/300/300
# network config
# network config
...
...
ui/snippets/navigation/NavigationDesktop.tsx
View file @
5ab4a08b
...
@@ -69,7 +69,9 @@ const NavigationDesktop = () => {
...
@@ -69,7 +69,9 @@ const NavigationDesktop = () => {
w=
"100%"
w=
"100%"
px=
{
{
lg
:
isExpanded
?
3
:
'
15px
'
,
xl
:
isCollapsed
?
'
15px
'
:
3
}
}
px=
{
{
lg
:
isExpanded
?
3
:
'
15px
'
,
xl
:
isCollapsed
?
'
15px
'
:
3
}
}
h=
{
10
}
h=
{
10
}
{
...
getDefaultTransitionProps
({
transitionProperty
:
'
padding
'
})
}
transitionProperty=
"padding"
transitionDuration=
"normal"
transitionTimingFunction=
"ease"
>
>
<
NetworkLogo
isCollapsed=
{
isCollapsed
}
/>
<
NetworkLogo
isCollapsed=
{
isCollapsed
}
/>
<
NetworkMenu
isCollapsed=
{
isCollapsed
}
/>
<
NetworkMenu
isCollapsed=
{
isCollapsed
}
/>
...
...
ui/snippets/networkMenu/NetworkLogo.tsx
View file @
5ab4a08b
import
{
Icon
,
Box
,
Image
,
useColorModeValue
,
useBreakpointValue
}
from
'
@chakra-ui/react
'
;
import
{
Icon
,
Box
,
Image
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
appConfig
from
'
configs/app/config
'
;
import
appConfig
from
'
configs/app/config
'
;
...
@@ -6,7 +6,6 @@ import smallLogoPlaceholder from 'icons/networks/icons/placeholder.svg';
...
@@ -6,7 +6,6 @@ import smallLogoPlaceholder from 'icons/networks/icons/placeholder.svg';
import
logoPlaceholder
from
'
icons/networks/logos/blockscout.svg
'
;
import
logoPlaceholder
from
'
icons/networks/logos/blockscout.svg
'
;
import
link
from
'
lib/link/link
'
;
import
link
from
'
lib/link/link
'
;
import
ASSETS
from
'
lib/networks/networkAssets
'
;
import
ASSETS
from
'
lib/networks/networkAssets
'
;
import
getDefaultTransitionProps
from
'
theme/utils/getDefaultTransitionProps
'
;
interface
Props
{
interface
Props
{
isCollapsed
?:
boolean
;
isCollapsed
?:
boolean
;
...
@@ -16,59 +15,71 @@ interface Props {
...
@@ -16,59 +15,71 @@ interface Props {
const
NetworkLogo
=
({
isCollapsed
,
onClick
}:
Props
)
=>
{
const
NetworkLogo
=
({
isCollapsed
,
onClick
}:
Props
)
=>
{
const
logoColor
=
useColorModeValue
(
'
blue.600
'
,
'
white
'
);
const
logoColor
=
useColorModeValue
(
'
blue.600
'
,
'
white
'
);
const
href
=
link
(
'
network_index
'
);
const
href
=
link
(
'
network_index
'
);
const
[
isLogoError
,
setLogoError
]
=
React
.
useState
(
false
);
const
[
isSmallLogoError
,
setSmallLogoError
]
=
React
.
useState
(
false
);
const
style
=
useColorModeValue
({},
{
filter
:
'
brightness(0) invert(1)
'
});
const
style
=
useColorModeValue
({},
{
filter
:
'
brightness(0) invert(1)
'
});
const
isLg
=
useBreakpointValue
({
base
:
false
,
lg
:
true
,
xl
:
false
},
{
ssr
:
true
});
const
logoEl
=
(()
=>
{
const
handleSmallLogoError
=
React
.
useCallback
(()
=>
{
const
showSmallLogo
=
isCollapsed
||
(
isCollapsed
!==
false
&&
isLg
);
setSmallLogoError
(
true
);
if
(
showSmallLogo
)
{
},
[]);
if
(
appConfig
.
network
.
smallLogo
)
{
return
(
<
Image
w=
"auto"
h=
"100%"
src=
{
appConfig
.
network
.
smallLogo
}
alt=
{
`${ appConfig.network.name } network logo`
}
/>
);
}
const
smallLogo
=
appConfig
.
network
.
type
?
ASSETS
[
appConfig
.
network
.
type
]?.
smallLogo
||
ASSETS
[
appConfig
.
network
.
type
]?.
icon
:
undefined
;
const
handleLogoError
=
React
.
useCallback
(()
=>
{
return
(
setLogoError
(
true
);
<
Icon
},
[]);
as=
{
smallLogo
||
smallLogoPlaceholder
}
width=
"auto"
height=
"100%"
color=
{
smallLogo
?
undefined
:
logoColor
}
{
...
getDefaultTransitionProps
()
}
style=
{
style
}
/>
);
}
if
(
appConfig
.
network
.
logo
)
{
const
logoEl
=
(()
=>
{
return
(
const
fallbackLogoSrc
=
appConfig
.
network
.
type
?
ASSETS
[
appConfig
.
network
.
type
]?.
logo
:
undefined
;
<
Image
const
fallbackSmallLogoSrc
=
appConfig
.
network
.
type
?
ASSETS
[
appConfig
.
network
.
type
]?.
smallLogo
||
ASSETS
[
appConfig
.
network
.
type
]?.
icon
:
undefined
;
w=
"auto"
h=
"100%"
src=
{
appConfig
.
network
.
logo
}
alt=
{
`${ appConfig.network.name } network logo`
}
/>
);
}
const
logo
=
appConfig
.
network
.
type
?
ASSETS
[
appConfig
.
network
.
type
]?.
logo
:
undefined
;
const
logo
=
appConfig
.
network
.
logo
;
return
(
const
smallLogo
=
appConfig
.
network
.
smallLogo
;
const
fallbackLogo
=
(
<
Icon
<
Icon
as=
{
logo
||
logoPlaceholder
}
as=
{
fallbackLogoSrc
||
logoPlaceholder
}
width=
"auto"
width=
"auto"
height=
"100%"
height=
"100%"
color=
{
logo
?
undefined
:
logoColor
}
color=
{
fallbackLogoSrc
?
undefined
:
logoColor
}
{
...
getDefaultTransitionProps
()
}
display=
{
{
base
:
'
block
'
,
lg
:
isCollapsed
===
false
?
'
block
'
:
'
none
'
,
xl
:
isCollapsed
?
'
none
'
:
'
block
'
}
}
style=
{
style
}
style=
{
style
}
/>
/>
);
);
const
fallbackSmallLogo
=
(
<
Icon
as=
{
fallbackSmallLogoSrc
||
smallLogoPlaceholder
}
width=
"auto"
height=
"100%"
color=
{
fallbackSmallLogoSrc
?
undefined
:
logoColor
}
display=
{
{
base
:
'
none
'
,
lg
:
isCollapsed
===
false
?
'
none
'
:
'
block
'
,
xl
:
isCollapsed
?
'
block
'
:
'
none
'
}
}
style=
{
style
}
/>
);
return
(
<>
{
/* big logo */
}
<
Image
w=
"auto"
h=
"100%"
src=
{
logo
}
display=
{
{
base
:
'
block
'
,
lg
:
isCollapsed
===
false
?
'
block
'
:
'
none
'
,
xl
:
isCollapsed
?
'
none
'
:
'
block
'
}
}
alt=
{
`${ appConfig.network.name } network logo`
}
fallback=
{
isLogoError
||
!
logo
?
fallbackSmallLogo
:
undefined
}
onError=
{
handleLogoError
}
/>
{
/* small logo */
}
<
Image
w=
"auto"
h=
"100%"
src=
{
smallLogo
}
display=
{
{
base
:
'
none
'
,
lg
:
isCollapsed
===
false
?
'
none
'
:
'
block
'
,
xl
:
isCollapsed
?
'
block
'
:
'
none
'
}
}
alt=
{
`${ appConfig.network.name } network logo`
}
fallback=
{
isSmallLogoError
||
!
smallLogo
?
fallbackLogo
:
undefined
}
onError=
{
handleSmallLogoError
}
/>
</>
);
})();
})();
return
(
return
(
...
@@ -82,7 +93,6 @@ const NetworkLogo = ({ isCollapsed, onClick }: Props) => {
...
@@ -82,7 +93,6 @@ const NetworkLogo = ({ isCollapsed, onClick }: Props) => {
overflow=
"hidden"
overflow=
"hidden"
onClick=
{
onClick
}
onClick=
{
onClick
}
flexShrink=
{
0
}
flexShrink=
{
0
}
{
...
getDefaultTransitionProps
({
transitionProperty
:
'
width
'
})
}
aria
-
label=
"Link to main page"
aria
-
label=
"Link to main page"
>
>
{
logoEl
}
{
logoEl
}
...
...
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