From d5e5019cc88001938453d079af9c6d582bfbb8ed Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 28 Jun 2022 14:01:26 +0100 Subject: [PATCH] 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 --- .../@shared/NetworkName/index.module.css | 8 +++-- .../AssetContent/MetaMain/index.module.css | 11 +++++-- src/components/Header/Menu.module.css | 33 ++++++++++++------- src/components/Header/Menu.tsx | 3 +- src/components/Header/SearchBar.module.css | 2 +- .../Networks/NetworkItem.module.css | 2 +- .../Header/UserPreferences/index.module.css | 23 ++----------- .../Header/Wallet/Account.module.css | 29 +++------------- src/components/Header/Wallet/Account.tsx | 4 +-- .../Header/Wallet/Network.module.css | 13 ++++++-- src/components/Header/index.module.css | 2 -- src/components/Header/index.tsx | 3 +- 12 files changed, 60 insertions(+), 73 deletions(-) delete mode 100644 src/components/Header/index.module.css diff --git a/src/components/@shared/NetworkName/index.module.css b/src/components/@shared/NetworkName/index.module.css index 6aab11504..01e4a6d21 100644 --- a/src/components/@shared/NetworkName/index.module.css +++ b/src/components/@shared/NetworkName/index.module.css @@ -22,7 +22,9 @@ width: 0; } -.minimal:hover .name { - width: auto; - opacity: 1; +@media screen and (min-width: 42rem) { + .minimal:hover .name { + width: auto; + opacity: 1; + } } diff --git a/src/components/Asset/AssetContent/MetaMain/index.module.css b/src/components/Asset/AssetContent/MetaMain/index.module.css index f04afa777..b56f0c246 100644 --- a/src/components/Asset/AssetContent/MetaMain/index.module.css +++ b/src/components/Asset/AssetContent/MetaMain/index.module.css @@ -1,11 +1,18 @@ .meta { - margin-left: calc(var(--spacer) * -1); - margin-right: calc(var(--spacer) * -1); + margin-left: calc(var(--spacer) * -0.75); + margin-right: calc(var(--spacer) * -0.75); margin-bottom: calc(var(--spacer) / 1.5); color: var(--color-secondary); font-size: var(--font-size-small); } +@media (min-width: 40rem) { + .meta { + margin-left: calc(var(--spacer) * -1); + margin-right: calc(var(--spacer) * -1); + } +} + .asset { display: flex; justify-content: flex-start; diff --git a/src/components/Header/Menu.module.css b/src/components/Header/Menu.module.css index d35de150c..3e27d5e55 100644 --- a/src/components/Header/Menu.module.css +++ b/src/components/Header/Menu.module.css @@ -1,9 +1,8 @@ .menu { width: 100%; - padding: calc(var(--spacer) / 2); + padding: calc(var(--spacer) / 2) calc(var(--spacer) / 3); display: flex; align-items: center; - justify-content: space-between; flex-wrap: wrap; } @@ -21,7 +20,6 @@ .badge { cursor: pointer; margin-top: -0.25rem; - position: relative; padding: calc(var(--spacer) / 5) calc(var(--spacer) / 4); } @@ -39,6 +37,7 @@ .actions { order: 2; display: flex; + margin-left: auto; } .title { @@ -47,7 +46,7 @@ @media screen and (min-width: 42rem) { .menu { - justify-content: start; + padding: calc(var(--spacer) / 2); } .navigation { @@ -138,18 +137,26 @@ 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); } -.caret, -svg.caret { - width: var(--font-size-mini); - height: var(--font-size-mini); +.badge .caret { fill: var(--brand-white); opacity: 0.7; - transition: transform 0.2s ease-out; - vertical-align: middle; + width: var(--font-size-mini); + height: var(--font-size-mini); margin-left: calc(var(--spacer) / 12); } @@ -158,6 +165,10 @@ svg.caret { svg.caret { display: inline-block; } + + .navigation { + margin-left: calc(var(--spacer) / 2); + } } .versions { diff --git a/src/components/Header/Menu.tsx b/src/components/Header/Menu.tsx index 7e0f090a5..03e5a8b4a 100644 --- a/src/components/Header/Menu.tsx +++ b/src/components/Header/Menu.tsx @@ -46,7 +46,7 @@ export default function Menu(): ReactElement { @@ -69,6 +69,7 @@ export default function Menu(): ReactElement { } /> +