Skip to content

Commit

Permalink
refactor(gh-pages): add share button to header
Browse files Browse the repository at this point in the history
  • Loading branch information
Natalie-Smirnova authored and ala-n committed May 18, 2023
1 parent be7aa83 commit 2fdaf4d
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 7 deletions.
17 changes: 11 additions & 6 deletions pages/src/navigation/header/header.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
height: @header-height-desktop;
}

@media @md-xl {
.landing-layout & {
background-color: transparent;
}
}

&-container {
display: flex;
align-items: center;
Expand Down Expand Up @@ -90,6 +84,17 @@
}
}

&-share-popup.esl-popup {
&, & > .esl-popup-arrow {
background: @landing-bg-color;
border-color: gray;
}
> .esl-share {
margin: .75rem;
gap: .25rem;
}
}

&-utility {
display: flex;
align-items: center;
Expand Down
22 changes: 22 additions & 0 deletions pages/src/navigation/sidebar/sidebar-primary-nav.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,28 @@ esl-d-sidebar {
margin-bottom: 5px;
}

// Share item
.sidebar-nav-item-share {
margin-top: 20px;
@media @md-xl {
display: none;
}

.esl-share-list {
gap: 15px;
}
.esl-share-button {
width: 30px;
height: 30px;
}
.sidebar-nav-item-heading {
gap: 15px;
@media @sm {
flex-direction: column;
}
}
}

// Primary Heading
.sidebar-nav-item-heading {
position: relative;
Expand Down
7 changes: 6 additions & 1 deletion pages/src/page/landing-layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
100% { background-position: 100vw 0; opacity: 1; }
}


.main-scroll {
position: absolute;
z-index: 5;
Expand All @@ -50,4 +49,10 @@
background: #2e2f35;
}
}

@media @md-xl {
.header {
background-color: transparent;
}
}
}
3 changes: 3 additions & 0 deletions pages/static/assets/common/header-share.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions pages/static/assets/share/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
}
],
"groups": [
{
"name": "site",
"list": "facebook twitter linkedin telegram copy"
},
{
"name": "demo",
"list": "facebook twitter linkedin wykop copy"
Expand Down
14 changes: 14 additions & 0 deletions pages/views/_includes/navigation/header.njk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@
{% include 'static/assets/common/header-search.svg' %}
</esl-trigger>
</li>
<li class="header-nav-item">
<esl-trigger target="::next" mode="toggle" track-click track-hover class="header-link icon-link">
{% include 'static/assets/common/header-share.svg' %}
</esl-trigger>
<esl-popup id="site-share-popup"
class="header-share-popup"
position="bottom"
default-params="{hideDelay: 500}"
close-on-esc
close-on-outside-action>
<esl-share list="group:site"></esl-share>
<span class="esl-popup-arrow"></span>
</esl-popup>
</li>
</ul>
<div class="header-utility">
<a class="header-btn btn btn-lg btn-sec-blue" href="{{ '/introduction' | url }}">Get started</a>
Expand Down
6 changes: 6 additions & 0 deletions pages/views/_includes/navigation/sidebar.njk
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
{{ navitem ('Drafts', 'draft', 'static/assets/common/flask.svg') }}
</li>
{% endif %}
<li class="sidebar-nav-item sidebar-nav-item-share">
<div class='sidebar-nav-item-heading'>
<span>Share us with:</span>
<esl-share list="group:site"></esl-share>
</div>
</li>
</ul>

<esl-scrollbar class="sidebar-scrollbar" target="::prev"></esl-scrollbar>
Expand Down

0 comments on commit 2fdaf4d

Please # to comment.