From e2acc0d499f9ac5671edc6dc75274097bcd20b42 Mon Sep 17 00:00:00 2001 From: dianeCdrPix Date: Fri, 8 Nov 2024 16:11:05 +0100 Subject: [PATCH 1/2] refactor(mon-pix): extract module navbar component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Latzarus --- mon-pix/app/components/module/_navbar.scss | 22 ++++++++++++++++ mon-pix/app/components/module/_passage.scss | 25 ------------------- mon-pix/app/components/module/navbar.gjs | 13 ++++++++++ mon-pix/app/components/module/passage.gjs | 17 ++----------- mon-pix/app/styles/app.scss | 1 + .../components/module/navbar_test.gjs | 18 +++++++++++++ 6 files changed, 56 insertions(+), 40 deletions(-) create mode 100644 mon-pix/app/components/module/_navbar.scss create mode 100644 mon-pix/app/components/module/navbar.gjs create mode 100644 mon-pix/tests/integration/components/module/navbar_test.gjs diff --git a/mon-pix/app/components/module/_navbar.scss b/mon-pix/app/components/module/_navbar.scss new file mode 100644 index 00000000000..1239148139b --- /dev/null +++ b/mon-pix/app/components/module/_navbar.scss @@ -0,0 +1,22 @@ +.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); + } + } +} diff --git a/mon-pix/app/components/module/_passage.scss b/mon-pix/app/components/module/_passage.scss index 12501fd489c..201470a007d 100644 --- a/mon-pix/app/components/module/_passage.scss +++ b/mon-pix/app/components/module/_passage.scss @@ -1,28 +1,3 @@ -.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/navbar.gjs b/mon-pix/app/components/module/navbar.gjs new file mode 100644 index 00000000000..c20cebbc7ce --- /dev/null +++ b/mon-pix/app/components/module/navbar.gjs @@ -0,0 +1,13 @@ +import { t } from 'ember-intl'; + diff --git a/mon-pix/app/components/module/passage.gjs b/mon-pix/app/components/module/passage.gjs index 9892a743d5e..a075a2b7643 100644 --- a/mon-pix/app/components/module/passage.gjs +++ b/mon-pix/app/components/module/passage.gjs @@ -2,12 +2,12 @@ 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'; import BetaBanner from './beta-banner'; import ModuleGrain from './grain.js'; +import ModuleNavbar from './navbar'; export default class ModulePassage extends Component { @service router; @@ -198,20 +198,7 @@ export default class ModulePassage extends Component {