-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create 'nav user' component * Add login link variant * Add nav user to the header and lab homepage template
- Loading branch information
1 parent
6e77454
commit 5ab3cf0
Showing
13 changed files
with
224 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="nav-user user-login mr-lg-2"> | ||
<a href="#" class="user-login-link"> | ||
{% include '@atoms/icon/icon.twig' with {'icon': 'user', icon_classes: 'feather'} %} | ||
<span class="label">Connexion</span> | ||
</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
.user-dropdown .btn { | ||
display: flex; | ||
align-items: center; | ||
padding: $btn-padding-y-sm $btn-padding-x-sm; | ||
border: 0; | ||
|
||
.user-avatar { | ||
--avatar-size: 2.5rem; | ||
flex-basis: var(--avatar-size); | ||
width: var(--avatar-size); | ||
|
||
@include media-breakpoint-up(sm) { | ||
--avatar-size: 2.625rem; | ||
} | ||
|
||
@include media-breakpoint-up(md) { | ||
--avatar-size: 2.875rem; | ||
} | ||
} | ||
|
||
p { | ||
margin: 0 0.5rem 0 1rem; | ||
} | ||
} | ||
|
||
.header .nav-user { | ||
margin-left: auto; | ||
|
||
|
||
& + .nav-lang { | ||
margin-left: 0 !important; | ||
} | ||
} | ||
|
||
.nav-user.user-login { | ||
position: relative; | ||
padding-left: 1.5rem; | ||
|
||
.icon { | ||
position: absolute; | ||
top: 4px; | ||
left: 0; | ||
margin-right: 0.25rem; | ||
} | ||
} | ||
|
||
|
||
@include media-breakpoint-down(lg) { | ||
.header .nav-user { | ||
margin-left: 1rem; | ||
margin-right: 1rem; | ||
} | ||
} | ||
|
||
@include media-breakpoint-down(sm) { | ||
|
||
.header .nav-user-login { | ||
padding: 0; | ||
|
||
.user-login-link { | ||
padding: 0.5em; | ||
} | ||
|
||
.label { | ||
@include sr-only; | ||
} | ||
.icon { | ||
position: static; | ||
width: 1.25rem; | ||
height: 1.25rem; | ||
margin: 0; | ||
} | ||
} | ||
|
||
.header .nav-user { | ||
margin-left: 0.5rem; | ||
margin-right: 0.5rem; | ||
|
||
& + .nav-lang-short > ul { | ||
padding-left: 0 !important; | ||
} | ||
|
||
.btn { | ||
padding: $btn-padding-y-sm; | ||
} | ||
|
||
&:not(.show) { | ||
.btn { | ||
border-radius: 50%; | ||
|
||
&:after { | ||
content: none; | ||
} | ||
} | ||
.user-name { | ||
@include sr-only; | ||
} | ||
} | ||
|
||
&.show { | ||
position: fixed; | ||
top: 0.625rem; | ||
right: 0.75rem; | ||
left: 0.75rem; | ||
//width: calc(100vw - 1.8rem); | ||
margin: 0; | ||
background: white; | ||
z-index: 1199; | ||
|
||
.btn { | ||
width: 100%; | ||
padding-left: $btn-padding-y; | ||
padding-right: $btn-padding-y; | ||
border: 2px solid $gray-600; | ||
border-bottom: 0; | ||
border-radius: 2px 2px 0 0; | ||
|
||
&:after { | ||
margin-left: auto; | ||
} | ||
} | ||
|
||
.dropdown-menu { | ||
top: -2px !important; | ||
left: 0 !important; | ||
width: 100%; | ||
border: 2px solid $gray-600; | ||
border-top: 0; | ||
border-radius: 0 0 2px 2px; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="nav-user dropdown user-dropdown mr-lg-2"> | ||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
<img class="user-avatar rounded-circle" src="https://randomuser.me/api/portraits/women/2.jpg" alt=""> | ||
<p class="user-name">Heidy Traill</p> | ||
</button> | ||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton"> | ||
<li class="dropdown-item"> | ||
{% include '@atoms/icon/icon.twig' with {'icon': 'user', icon_classes: 'feather'} %} | ||
<a href="#">Accéder à mon compte</a> | ||
</li> | ||
<li class="dropdown-item"> | ||
{% include '@atoms/icon/icon.twig' with {'icon': 'log-out', icon_classes: 'feather'} %} | ||
<a href="#">Me déconnecter</a> | ||
</li> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
title: Nav user | ||
name: nav-user | ||
notes: | | ||
* If included in the header, the user dropdown and login link should be placed between the search form and language selector. | ||
* If you choose to place it elsewhere, you may need to adjust the Boostratp margin classes on the `.nav-user` element. | ||
* An example of user menu integration can be found on the [Laboratory Homepage](#/pages/lab-homepage) template page. | ||
variants: | ||
- name: login | ||
title: Login link | ||
notes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters