Skip to content

Commit 04bd4d3

Browse files
author
Emmanuelle BONOLI
committed
create activity card
2 parents 1a3e55f + 05ad873 commit 04bd4d3

File tree

15 files changed

+66
-15
lines changed

15 files changed

+66
-15
lines changed

public/activities/tempActivitiesData.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"id": 2,
2323
"title": "Collecte alimentaire",
2424
"description": "Aidez-nous à collecter et distribuer des denrées aux personnes dans le besoin.",
25-
"image": ["/activities/tempImageData/maraude.png"],
25+
"image": ["/activities/tempImageData/collecteAlimentaire.png"],
2626
"organization": {
2727
"name": "Les Restos du Cœur",
28-
"logo": "/activities/tempImageData/logoCroixRouge.png",
28+
"logo": "/activities/tempImageData/restoDuCoeur.png",
2929
"isFollow": true
3030
},
3131
"location": "Lyon",
@@ -41,10 +41,10 @@
4141
"id": 3,
4242
"title": "Soutien scolaire",
4343
"description": "Nous recherchons des bénévoles pour aider des enfants en difficulté scolaire.",
44-
"image": ["/activities/tempImageData/maraude.png"],
44+
"image": ["/activities/tempImageData/soutienScolaire.jpg"],
4545
"organization": {
4646
"name": "Éducation Pour Tous",
47-
"logo": "/activities/tempImageData/logoCroixRouge.png",
47+
"logo": "/activities/tempImageData/educationPourTous.png",
4848
"isFollow": true
4949
},
5050
"location": "Paris",
@@ -63,13 +63,13 @@
6363
"image": ["/activities/tempImageData/SPA.png"],
6464
"organization": {
6565
"name": "SPA",
66-
"logo": "/activities/tempImageData/logoCroixRouge.png",
66+
"logo": "/activities/tempImageData/logoSPA.png",
6767
"isFollow": false
6868
},
6969
"location": "Marseille",
7070
"date": "2024-12-15",
7171
"participants": {
72-
"current": 3,
72+
"current": 10,
7373
"max": 10
7474
},
7575
"theme": ["Nature"],
111 KB
Loading
132 KB
Loading
93.7 KB
Loading
9.78 KB
Loading
42.1 KB
Loading

src/app/features/activity/components/activity-card/activity-card.component.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
<div class="description-card">
44
<div class="header-description">
55
<h3>{{ activity.title }}</h3>
6-
<p>Badge volonteers</p>
7-
<!-- TODO: changer pour le composant réutilisable -->
6+
@if (activity) {
7+
<app-inscription-badge [participants]="activity.participants"></app-inscription-badge>
8+
}
89
</div>
910
<p>
1011
{{ activity.description }}
@@ -19,15 +20,13 @@ <h3>{{ activity.title }}</h3>
1920
<div class="footer-details">
2021
<div class="location">
2122
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
22-
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
2323
<path
2424
d="M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z" />
2525
</svg>
2626
<p class="mini-p">{{ activity.location }}</p>
2727
</div>
2828
<div class="date">
2929
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
30-
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
3130
<path
3231
d="M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zm64 80l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm128 0l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 400l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z" />
3332
</svg>

src/app/features/activity/components/activity-card/activity-card.component.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
.activity-image {
1212
width: 100%;
1313
filter: brightness(80%);
14+
border-radius: var(--border-radius) var(--border-radius) 0 0;
1415
}
1516

1617
h3 {
@@ -26,7 +27,7 @@
2627
display: flex;
2728
flex-direction: column;
2829
justify-content: space-between;
29-
padding: 5% 5% 0% 5%;
30+
padding: 5% 5% 0 5%;
3031

3132
.header-description {
3233
display: flex;
@@ -38,6 +39,10 @@
3839
display: flex;
3940
align-items: center;
4041
gap: 2%;
42+
43+
img {
44+
width: 25px;
45+
}
4146
}
4247

4348
.push-footer {

src/app/features/activity/components/activity-card/activity-card.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { Component, Input } from '@angular/core';
22
import { Activity } from '../../models/activity.model';
3+
import { InscriptionBadgeComponent } from '../inscription-badge/inscription-badge.component';
34

45
@Component({
56
selector: 'app-activity-card',
6-
imports: [],
7+
imports: [InscriptionBadgeComponent],
78
templateUrl: './activity-card.component.html',
89
styleUrl: './activity-card.component.scss',
10+
standalone: true,
911
})
1012
export class ActivityCardComponent {
1113
@Input() activity!: Activity;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@if (participants) {
2+
<div class="badge-container">
3+
@if (participants.current === participants.max) {
4+
<p class="badge full">Complet</p>
5+
} @else {
6+
<p class="badge">{{ participants.current }} / {{ participants.max }} pers.</p>
7+
}
8+
</div>
9+
}

0 commit comments

Comments
 (0)