Skip to content

Commit

Permalink
tech(pix-return-to): update icon
Browse files Browse the repository at this point in the history
  • Loading branch information
xav-car committed Oct 11, 2024
1 parent bcc3999 commit 139f322
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions addon/components/pix-return-to.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
...attributes
>
{{#if (has-block)}}
<span aria-hidden="true" class="pix-return-to__icon"><FaIcon @icon="arrow-left" /></span>
<PixIcon @name="arrowLeft" @ariaHidden={{true}} class="pix-return-to__icon" />
<span class="pix-return-to__text"> {{yield}} </span>
{{else}}
<span title="Flèche de retour" class="pix-return-to__icon"><FaIcon @icon="arrow-left" /></span>
<PixIcon class="pix-return-to__icon" aria-label={{@arrowLabel}} @name="arrowLeft" />
{{/if}}
</LinkTo>
5 changes: 3 additions & 2 deletions addon/styles/_pix-return-to.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@

&__icon {
position: relative;
width: 2.3rem;
height: 2.3rem;
padding: var(--pix-spacing-1x) var(--pix-spacing-2x);
font-size: 1rem;
}

&:focus,
Expand All @@ -29,11 +30,11 @@
&:hover,
&:active {
.pix-return-to__icon {
color: $arrowHoverColor;
background-color: $arrowBgColor;
border-radius: 50%;
outline: 1px solid var(--pix-neutral-0);
outline-offset: -3px;
fill: $arrowHoverColor;
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion app/stories/pix-return-to.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { hbs } from 'ember-cli-htmlbars';
export default {
title: 'Basics/Return To',
render: (args) => ({
template: hbs`<PixReturnTo @route='profile' @shade={{this.shade}}>{{this.content}}</PixReturnTo>`,
template: hbs`<PixReturnTo
@route='profile'
@arrowLabel={{this.arrowLabel}}
@shade={{this.shade}}
>{{this.content}}</PixReturnTo>`,
context: args,
}),
argTypes: {
Expand All @@ -12,6 +16,11 @@ export default {
description: 'Route de redirection',
type: { name: 'string', required: true },
},
arrowLabel: {
name: 'arrowLabel',
description: 'Texte du bouton de retour',
type: { required: false },
},
model: {
name: 'model',
description: 'Model Ember',
Expand Down

0 comments on commit 139f322

Please sign in to comment.