Adjust chain empty logo (background) (#3470)

* Adjust chain empty logo (background)

* Slight adjustment
This commit is contained in:
Jaco Greeff 2020-08-21 16:55:51 +02:00 committed by GitHub
parent d951da5647
commit b4e10c9661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 21 deletions

View File

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="15 15 140 140" style="enable-background:new 0 0 170 170;" xml:space="preserve">
<style type="text/css">
.bg0{fill:#888;}
</style>
<g><circle class="bg0" cx="85" cy="85" r="70"/></g>
<style type="text/css">.bg{fill: rgba(255, 255, 255, 0.5)}</style>
<g><circle class="bg" cx="85" cy="85" r="70"/></g>
</svg>

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 379 B

View File

@ -168,22 +168,13 @@ export default React.memo(styled(Menu)`
&.menuBg,
.menuBg {
&:after {
background: #fff;
bottom: 0;
content: ' ';
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: -2;
}
background: white;
&:before {
bottom: 0;
content: ' ';
left: 0;
opacity: 0.125;
opacity: 0.1;
position: absolute;
right: 0;
top: 0;
@ -192,9 +183,7 @@ export default React.memo(styled(Menu)`
}
&.isLoading.menuBg {
&:after {
background: #eee;
}
background: #eee;
&:before {
filter: grayscale(1);

View File

@ -19,14 +19,16 @@ function sanitize (value?: string): string {
function ChainImg ({ className = '', logo, onClick }: Props): React.ReactElement<Props> {
const { systemChain, systemName } = useApi();
const img = useMemo((): string => {
return (namedLogos[logo || ''] || chainLogos[sanitize(systemChain)] || nodeLogos[sanitize(systemName)] || emptyLogo) as string;
const [isEmpty, img] = useMemo((): [boolean, string] => {
const found: unknown = namedLogos[logo || ''] || chainLogos[sanitize(systemChain)] || nodeLogos[sanitize(systemName)];
return [!found || logo === 'empty', (found || emptyLogo) as string];
}, [logo, systemChain, systemName]);
return (
<img
alt='chain logo'
className={className}
className={`${className}${isEmpty ? ' ui--highlight--bg' : ''}`}
onClick={onClick}
src={img}
/>