diff --git a/CHANGELOG.md b/CHANGELOG.md index 24c30e0d90..0b256a4cc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - [#2235](https://github.com/poanetwork/blockscout/pull/2235) - save and show additional validation fields to smart contract ### Fixes +- [#2238](https://github.com/poanetwork/blockscout/pull/2238) - header content alignment issue, hide navbar on outside click - [#2229](https://github.com/poanetwork/blockscout/pull/2229) - gap issue between qr and copy button in token transfers, top cards width and height issue - [#2201](https://github.com/poanetwork/blockscout/pull/2201) - footer columns fix - [#2179](https://github.com/poanetwork/blockscout/pull/2179) - fix docker build error diff --git a/apps/block_scout_web/assets/css/components/_navbar.scss b/apps/block_scout_web/assets/css/components/_navbar.scss index 7f0b81f803..1058c529c6 100644 --- a/apps/block_scout_web/assets/css/components/_navbar.scss +++ b/apps/block_scout_web/assets/css/components/_navbar.scss @@ -21,9 +21,9 @@ $navbar-logo-width: auto !default; .nav-item { font-size: 14px; } - .navbar-nav { - flex-grow: 1; + .navbar-nav { + .nav-link { align-items: center; color: $header-links-color; @@ -153,6 +153,18 @@ $navbar-logo-width: auto !default; @include media-breakpoint-up(xl) { width: 280px; } + @media (min-width: 1366px) { + width: 330px; + } + @media (min-width: 1440px) { + width: 380px; + } + @media (min-width: 1580px) { + width: 430px; + } + @media (min-width: 1800px) { + width: 520px; + } } .input-group-append { height: 38px; @@ -198,7 +210,7 @@ $navbar-logo-width: auto !default; width: 100%; .awesomplete { - @include media-breakpoint-down(sm) { + @include media-breakpoint-down(lg) { width: 100%; } } @@ -210,6 +222,10 @@ $navbar-logo-width: auto !default; .navbar-brand { margin-left: 0; + flex-shrink: 1; + .navbar-logo { + max-width: 100%; + } } .navbar-logo { @@ -227,3 +243,18 @@ $navbar-logo-width: auto !default; .add-border { border: 1px solid transparentize($white, 0.30); } + +.navbar-collapse { + justify-content: flex-end; + align-items: flex-start; + flex-shrink: 0; + @media (min-width: 992px) { + align-items: center; + } +} + +.navbar-container, .navbar-primary { + @include media-breakpoint-up(xl) { + padding-right: 0; + } +} \ No newline at end of file diff --git a/apps/block_scout_web/assets/js/app.js b/apps/block_scout_web/assets/js/app.js index f486eb2111..e791a6b7ff 100644 --- a/apps/block_scout_web/assets/js/app.js +++ b/apps/block_scout_web/assets/js/app.js @@ -31,6 +31,7 @@ import './pages/chain' import './pages/pending_transactions' import './pages/transaction' import './pages/transactions' +import './pages/layout' import './pages/admin/tasks.js' diff --git a/apps/block_scout_web/assets/js/pages/layout.js b/apps/block_scout_web/assets/js/pages/layout.js new file mode 100644 index 0000000000..6974569969 --- /dev/null +++ b/apps/block_scout_web/assets/js/pages/layout.js @@ -0,0 +1,9 @@ +import $ from 'jquery' + +$(document).click(function (event) { + var clickover = $(event.target) + var _opened = $('.navbar-collapse').hasClass('show') + if (_opened === true && $('.navbar').find(clickover).length < 1) { + $('.navbar-toggler').click() + } +}) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex index f2a4e9441e..929cd30ab7 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex @@ -1,5 +1,5 @@