Skip to content

Commit

Permalink
[FEATURE] Ajouter un cadre autour des média des épreuves (Pix-12894)
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Jun 14, 2024
2 parents d9cae7c + a3fb3ab commit ab7e034
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.challenge-actions {
display: flex;
justify-content: space-between;
margin: 16px auto;
margin: var(--pix-spacing-8x) auto;

button:only-child {
margin-left: auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
&__media {
width: 60%;
margin-right: var(--pix-spacing-6x);
padding: var(--pix-spacing-4x);
background-color: var(--pix-neutral-0);
border-radius: 24px;
box-shadow: 0 0 1px 0 var(--pix-primary-500), 8px 8px 32px -8px rgb(63 125 216 / 35%);

&--single-display {
width: unset;
Expand All @@ -33,7 +37,6 @@

&__qrocm {
align-items: center;
padding: 20px 20px;
}

&__qcm, &__qcu {
Expand Down
4 changes: 2 additions & 2 deletions junior/app/pods/components/challenge/item/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import Component from '@glimmer/component';

export default class Item extends Component {
get isMediaWithForm() {
return this.args.challenge.hasForm && this.#hasMedia;
return this.args.challenge.hasForm && this.hasMedia;
}

get #hasMedia() {
get hasMedia() {
return this.args.challenge.illustrationUrl || this.args.challenge.hasValidEmbedDocument;
}
}
36 changes: 19 additions & 17 deletions junior/app/pods/components/challenge/item/template.hbs
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<div class="challenge-item {{unless this.isMediaWithForm 'challenge-item--single-display'}}">
<div class="challenge-item__media {{unless this.isMediaWithForm 'challenge-item__media--single-display'}}">
{{#if @challenge.illustrationUrl}}
<div class="challenge-item__image">
<Challenge::ChallengeIllustration @src={{@challenge.illustrationUrl}} @alt={{@challenge.illustrationAlt}} />
</div>
{{/if}}
{{#if @challenge.hasValidEmbedDocument}}
<div class="challenge-item__embed">
<Challenge::ChallengeEmbedSimulator
@url={{@challenge.embedUrl}}
@title={{@challenge.embedTitle}}
@height={{@challenge.embedHeight}}
@hideSimulator={{@isDisabled}}
/>
</div>
{{/if}}
</div>
{{#if this.hasMedia}}
<div class="challenge-item__media {{unless this.isMediaWithForm 'challenge-item__media--single-display'}}">
{{#if @challenge.illustrationUrl}}
<div class="challenge-item__image">
<Challenge::ChallengeIllustration @src={{@challenge.illustrationUrl}} @alt={{@challenge.illustrationAlt}} />
</div>
{{/if}}
{{#if @challenge.hasValidEmbedDocument}}
<div class="challenge-item__embed">
<Challenge::ChallengeEmbedSimulator
@url={{@challenge.embedUrl}}
@title={{@challenge.embedTitle}}
@height={{@challenge.embedHeight}}
@hideSimulator={{@isDisabled}}
/>
</div>
{{/if}}
</div>
{{/if}}
<div class="challenge-item__proposals {{unless this.isMediaWithForm 'challenge-item__proposals--single-display'}}">
{{#if @challenge.autoReply}}
<div class="challenge-item__autoreply">
Expand Down
2 changes: 1 addition & 1 deletion junior/app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ body {
font-weight: 600;
font-family: $font-nunito;
text-align: center;
background: rgb(var(--pix-primary-50) 0.2);
background: rgba(236 242 251 / 20%);
}

b {
Expand Down

0 comments on commit ab7e034

Please sign in to comment.