From ef4de4258e925fc5e98b53eca5f882fca7cb7570 Mon Sep 17 00:00:00 2001 From: dianeCdrPix Date: Thu, 7 Nov 2024 11:43:24 +0100 Subject: [PATCH 1/3] feat(mon-pix): add modulix navbar with current step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Yann Bertrand Co-authored-by: Clément Latzarus --- mon-pix/app/components/module/_passage.scss | 25 +++++++++++++++++++ mon-pix/app/components/module/passage.gjs | 22 +++++++++++++++- mon-pix/app/styles/pages/_module.scss | 4 ++- .../components/module/passage_test.gjs | 3 +++ mon-pix/translations/en.json | 5 +++- mon-pix/translations/es.json | 5 +++- mon-pix/translations/fr.json | 5 +++- mon-pix/translations/nl.json | 5 +++- 8 files changed, 68 insertions(+), 6 deletions(-) diff --git a/mon-pix/app/components/module/_passage.scss b/mon-pix/app/components/module/_passage.scss index 201470a007d..12501fd489c 100644 --- a/mon-pix/app/components/module/_passage.scss +++ b/mon-pix/app/components/module/_passage.scss @@ -1,3 +1,28 @@ +.module-navbar { + position: sticky; + top: 0; + z-index: var(--modulix-z-index-above-all); + height: var(--module-navbar-height); + padding: var(--pix-spacing-4x); + background: var(--pix-neutral-0); + box-shadow: 0 4px 20px 0 rgb(0 0 0 / 6%); + + &__content { + display: flex; + max-width: var(--modulix-max-content-width); + margin: 0 auto; + + &__current-step { + padding: var(--pix-spacing-1x) var(--pix-spacing-2x); + color: var(--pix-primary-700); + background-color: var(--pix-primary-100); + border-radius: var(--modulix-radius-xs); + } + } + + +} + .module-passage { max-width: var(--modulix-max-content-width); margin: 0 auto; diff --git a/mon-pix/app/components/module/passage.gjs b/mon-pix/app/components/module/passage.gjs index d8e8de93d20..9892a743d5e 100644 --- a/mon-pix/app/components/module/passage.gjs +++ b/mon-pix/app/components/module/passage.gjs @@ -2,6 +2,7 @@ import { action } from '@ember/object'; import { service } from '@ember/service'; import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; +import { t } from 'ember-intl'; import { pageTitle } from 'ember-page-title'; import didInsert from '../../modifiers/modifier-did-insert'; @@ -34,6 +35,10 @@ export default class ModulePassage extends Component { return this.grainsToDisplay.length - 1; } + get currentPassageStep() { + return this.currentGrainIndex + 1; + } + @action onGrainSkip() { const currentGrain = this.displayableGrains[this.currentGrainIndex]; @@ -193,9 +198,24 @@ export default class ModulePassage extends Component {