-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(junior): display identified learner on every relevant pages
- Loading branch information
1 parent
be52f04
commit 177a8b6
Showing
15 changed files
with
157 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import PixButton from '@1024pix/pix-ui/components/pix-button'; | ||
import PixIcon from '@1024pix/pix-ui/components/pix-icon'; | ||
import {action} from '@ember/object'; | ||
import {service} from '@ember/service'; | ||
import Component from '@glimmer/component'; | ||
import {t} from 'ember-intl'; | ||
|
||
export default class IdentifiedLearner extends Component { | ||
@service router; | ||
@service currentLearner; | ||
|
||
get currentUserDisplayName() { | ||
return this.currentLearner.learner.displayName; | ||
} | ||
|
||
@action | ||
disconnect() { | ||
this.router.transitionTo(this.currentLearner.learner.schoolUrl); | ||
} | ||
|
||
<template> | ||
<div class="identified-learner"> | ||
<div class="identified-learner__informations"> | ||
<p>{{this.currentUserDisplayName}}</p> | ||
<PixButton @variant="tertiary" @iconBefore="logout" @triggerAction={{this.disconnect}}> | ||
{{t "components.login.logout-button"}} | ||
</PixButton> | ||
</div> | ||
<PixIcon class="identified-learner__icon" @name="userCircle" /> | ||
</div> | ||
</template> | ||
} |
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,11 @@ | ||
.header_container { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: flex-start; | ||
|
||
.identified-learner { | ||
// Negative margin to set identified user outside the container on the far right | ||
// Equals half of the total margin outside the challenge content + offset | ||
margin-right: calc(((100% - 100vw) / 2) + 45px); | ||
} | ||
} |
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,30 @@ | ||
.identified-learner { | ||
align-items: center; | ||
display: flex; | ||
gap: var(--pix-spacing-3x); | ||
font-weight: var(--font-medium); | ||
|
||
&__informations { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: end; | ||
|
||
button { | ||
padding: 0; | ||
} | ||
|
||
p { | ||
font-weight: var(--pix-font-bold); | ||
white-space: nowrap; | ||
} | ||
} | ||
|
||
&__icon { | ||
background-color: var(--pix-primary-300); | ||
border-radius: 50%; | ||
fill: var(--pix-neutral-0); | ||
padding: var(--pix-spacing-1x); | ||
height: 40px; | ||
width: 40px; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -34,3 +34,9 @@ | |
} | ||
} | ||
} | ||
|
||
.header_container { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: flex-start; | ||
} |
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