Skip to content

Commit

Permalink
feat(junior): add buble for started mission
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaelle YAMA authored Aug 7, 2024
1 parent 78f6f1b commit c51dce8
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 10 deletions.
7 changes: 5 additions & 2 deletions junior/app/components/mission-card/mission-card.gjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import MissionCardBackGround from './mission-card-background';

<template>
<div class="mission-card__container">
{{#if @missionLabelStatus}}
<div class="status">

<p>{{@missionLabelStatus}}</p>
</div>
{{/if}}
{{#if @displayStartedIcon}}
<div class="started-icon">
<img src="/images/mission/icon/started-icon.svg" alt="" />
</div>
{{/if}}

<div class="mission-icon">
<img src="/images/mission/icon/area-code-{{@areaCode}}.svg" alt="" />
Expand Down
4 changes: 2 additions & 2 deletions junior/app/controllers/identified/missions/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ export default class List extends Controller {
}

@action
_hasMissionStarted(missionId) {
hasMissionStarted(missionId) {
return this.model.organizationLearner.startedMissionIds?.includes(missionId);
}

_getStatus(missionId) {
return this._hasMissionStarted(missionId) ? 'started' : 'to-start';
return this.hasMissionStarted(missionId) ? 'started' : 'to-start';
}

@action
Expand Down
12 changes: 6 additions & 6 deletions junior/app/styles/components/mission-card/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@
}
}

.started-icon{
position: absolute;
top: -32px;
left: 164px;
}

.mission-card-bottom {
//display: flex;
//flex-direction: column;
//align-content: center;
//align-self: center;
//justify-content: center;
////width: 200px;
margin-top: var(--pix-spacing-2x);

.mission-name {
Expand Down
1 change: 1 addition & 0 deletions junior/app/templates/identified/missions/list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
@missionButtonLabel={{this.getMissionButtonLabel mission.id}}
@title={{mission.name}}
@areaCode={{mission.areaCode}}
@displayStartedIcon={{this.hasMissionStarted mission.id}}
/>
{{/if}}
</PixButton>
Expand Down
27 changes: 27 additions & 0 deletions junior/public/images/mission/icon/started-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c51dce8

Please sign in to comment.