1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

header space saving & interaction tweaks (#1549)

* header space saving & interaction tweaks

* remove network name reveal interaction on small viewports
* increase header button sizes for all viewports for better tap targets
* tweak flex layout
* remove caret from version badge on smaller viewports

* fix NFT tooltip icon placement

* spacing tweak

* caret css cleanup

* remove reconnecting message

* squeeze more space out of network, test label

* more space from unsupported network indicator
This commit is contained in:
Matthias Kretschmann 2022-06-28 14:01:26 +01:00 committed by GitHub
parent 8249ff1397
commit d5e5019cc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 60 additions and 73 deletions

View File

@ -22,7 +22,9 @@
width: 0; width: 0;
} }
.minimal:hover .name { @media screen and (min-width: 42rem) {
width: auto; .minimal:hover .name {
opacity: 1; width: auto;
opacity: 1;
}
} }

View File

@ -1,11 +1,18 @@
.meta { .meta {
margin-left: calc(var(--spacer) * -1); margin-left: calc(var(--spacer) * -0.75);
margin-right: calc(var(--spacer) * -1); margin-right: calc(var(--spacer) * -0.75);
margin-bottom: calc(var(--spacer) / 1.5); margin-bottom: calc(var(--spacer) / 1.5);
color: var(--color-secondary); color: var(--color-secondary);
font-size: var(--font-size-small); font-size: var(--font-size-small);
} }
@media (min-width: 40rem) {
.meta {
margin-left: calc(var(--spacer) * -1);
margin-right: calc(var(--spacer) * -1);
}
}
.asset { .asset {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;

View File

@ -1,9 +1,8 @@
.menu { .menu {
width: 100%; width: 100%;
padding: calc(var(--spacer) / 2); padding: calc(var(--spacer) / 2) calc(var(--spacer) / 3);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
} }
@ -21,7 +20,6 @@
.badge { .badge {
cursor: pointer; cursor: pointer;
margin-top: -0.25rem; margin-top: -0.25rem;
position: relative;
padding: calc(var(--spacer) / 5) calc(var(--spacer) / 4); padding: calc(var(--spacer) / 5) calc(var(--spacer) / 4);
} }
@ -39,6 +37,7 @@
.actions { .actions {
order: 2; order: 2;
display: flex; display: flex;
margin-left: auto;
} }
.title { .title {
@ -47,7 +46,7 @@
@media screen and (min-width: 42rem) { @media screen and (min-width: 42rem) {
.menu { .menu {
justify-content: start; padding: calc(var(--spacer) / 2);
} }
.navigation { .navigation {
@ -138,18 +137,26 @@
text-transform: none; text-transform: none;
} }
.tooltip[aria-expanded='true'] svg { .caret,
svg.caret {
display: none;
width: var(--font-size-small);
height: var(--font-size-small);
fill: var(--border-color);
transition: transform 0.2s ease-out;
vertical-align: middle;
margin-left: calc(var(--spacer) / 4);
}
[aria-expanded='true'] .caret {
transform: rotate(180deg); transform: rotate(180deg);
} }
.caret, .badge .caret {
svg.caret {
width: var(--font-size-mini);
height: var(--font-size-mini);
fill: var(--brand-white); fill: var(--brand-white);
opacity: 0.7; opacity: 0.7;
transition: transform 0.2s ease-out; width: var(--font-size-mini);
vertical-align: middle; height: var(--font-size-mini);
margin-left: calc(var(--spacer) / 12); margin-left: calc(var(--spacer) / 12);
} }
@ -158,6 +165,10 @@ svg.caret {
svg.caret { svg.caret {
display: inline-block; display: inline-block;
} }
.navigation {
margin-left: calc(var(--spacer) / 2);
}
} }
.versions { .versions {

View File

@ -46,7 +46,7 @@ export default function Menu(): ReactElement {
</Link> </Link>
<Tooltip <Tooltip
className={styles.tooltip} className={styles.badgeWrap}
content={ content={
<div className={styles.versions}> <div className={styles.versions}>
<a className={styles.link} href={appConfig.v3MarketUri}> <a className={styles.link} href={appConfig.v3MarketUri}>
@ -69,6 +69,7 @@ export default function Menu(): ReactElement {
} }
/> />
</Tooltip> </Tooltip>
<ul className={styles.navigation}> <ul className={styles.navigation}>
{siteContent?.menu.map((item: MenuItem) => ( {siteContent?.menu.map((item: MenuItem) => (
<li key={item.name}> <li key={item.name}>

View File

@ -28,7 +28,7 @@
.input { .input {
font-size: 16px; /* prevent zoom in on input focus on mobile devices */ font-size: 16px; /* prevent zoom in on input focus on mobile devices */
background-color: transparent; background-color: transparent;
height: 36px; height: 41px;
margin: 0; margin: 0;
outline: 0; outline: 0;
padding-right: var(--spacer); padding-right: var(--spacer);

View File

@ -1,6 +1,6 @@
.radioWrap { .radioWrap {
composes: radioWrap from '@shared/FormInput/InputRadio.module.css'; composes: radioWrap from '@shared/FormInput/InputRadio.module.css';
padding: calc(var(--spacer) / 6) calc(var(--spacer) / 3); padding: calc(var(--spacer) / 4) calc(var(--spacer) / 3);
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
} }

View File

@ -1,5 +1,5 @@
.preferences { .preferences {
padding: calc(var(--spacer) / 6) calc(var(--spacer) / 3); padding: calc(var(--spacer) / 4) calc(var(--spacer) / 3);
cursor: pointer; cursor: pointer;
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
border-radius: var(--border-radius); border-radius: var(--border-radius);
@ -13,25 +13,8 @@
vertical-align: middle; vertical-align: middle;
} }
.preferences[aria-expanded='true'] svg { .caret {
transform: rotate(180deg); composes: caret from '../Menu.module.css';
}
.caret,
svg.caret {
width: var(--font-size-small);
height: var(--font-size-small);
fill: var(--border-color);
margin-left: calc(var(--spacer) / 4);
transition: transform 0.2s ease-out;
display: none;
}
@media screen and (min-width: 42rem) {
.caret,
svg.caret {
display: inline-block;
}
} }
.icon { .icon {

View File

@ -5,7 +5,7 @@
text-transform: uppercase; text-transform: uppercase;
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
border-radius: var(--border-radius); border-radius: var(--border-radius);
padding: calc(var(--spacer) / 6) calc(var(--spacer) / 3); padding: calc(var(--spacer) / 4) calc(var(--spacer) / 3);
white-space: nowrap; white-space: nowrap;
background: var(--background-content); background: var(--background-content);
margin: 0; margin: 0;
@ -38,6 +38,7 @@
@media screen and (min-width: 42rem) { @media screen and (min-width: 42rem) {
.button.initial span { .button.initial span {
display: inline; display: inline;
margin-left: 0.2rem;
} }
} }
@ -59,34 +60,12 @@
} }
} }
.button svg {
width: 1em;
height: 1em;
fill: var(--border-color);
display: inline-block;
vertical-align: middle;
margin-left: calc(var(--spacer) / 3);
transition: transform 0.2s ease-out;
}
[aria-expanded='true'] .button svg {
transform: rotate(180deg);
}
.status { .status {
margin-left: calc(var(--spacer) / 4); margin-left: calc(var(--spacer) / 4);
position: relative; position: relative;
top: 1px; top: 1px;
} }
.caret, .caret {
svg.caret { composes: caret from '../Menu.module.css';
display: none;
}
@media screen and (min-width: 42rem) {
.caret,
svg.caret {
display: inline-block;
}
} }

View File

@ -21,7 +21,7 @@ const Account = React.forwardRef((props, ref: any) => {
return !accountId && web3Modal?.cachedProvider ? ( return !accountId && web3Modal?.cachedProvider ? (
// Improve user experience for cached provider when connecting takes some time // Improve user experience for cached provider when connecting takes some time
<button className={styles.button} onClick={(e) => e.preventDefault()}> <button className={styles.button} onClick={(e) => e.preventDefault()}>
<Loader message="Reconnecting..." /> <Loader />
</button> </button>
) : accountId ? ( ) : accountId ? (
<button <button
@ -44,7 +44,7 @@ const Account = React.forwardRef((props, ref: any) => {
// the Tippy to show in this state. // the Tippy to show in this state.
ref={ref} ref={ref}
> >
Connect&nbsp;<span>Wallet</span> Connect <span>Wallet</span>
</button> </button>
) )
}) })

View File

@ -3,23 +3,30 @@
border-right: none; border-right: none;
border-top-left-radius: var(--border-radius); border-top-left-radius: var(--border-radius);
border-bottom-left-radius: var(--border-radius); border-bottom-left-radius: var(--border-radius);
padding: calc(var(--spacer) / 6) calc(var(--spacer) / 3); padding: calc(var(--spacer) / 4) calc(var(--spacer) / 8);
white-space: nowrap; white-space: nowrap;
margin-right: -3px; margin-right: -3px;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
} }
@media screen and (min-width: 42rem) {
.network {
padding: calc(var(--spacer) / 4);
}
}
.name { .name {
font-size: var(--font-size-small); font-size: var(--font-size-small);
} }
.badge { .badge {
margin-left: calc(var(--spacer) / 8); margin-left: -0.25rem;
background-color: var(--border-color); background-color: var(--border-color);
color: var(--font-color-text); color: var(--font-color-text);
font-size: calc(var(--font-size-mini) * 0.8);
} }
.warning { .warning {
margin-right: calc(var(--spacer) / 4); margin-right: calc(var(--spacer) / 14);
} }

View File

@ -1,2 +0,0 @@
.header {
}

View File

@ -1,10 +1,9 @@
import React, { ReactElement } from 'react' import React, { ReactElement } from 'react'
import Menu from './Menu' import Menu from './Menu'
import styles from './index.module.css'
export default function Header(): ReactElement { export default function Header(): ReactElement {
return ( return (
<header className={styles.header}> <header>
<Menu /> <Menu />
</header> </header>
) )