Skip to content

Commit d9d2f1c

Browse files
Merge pull request #7 from WildCodeSchool/feature/issue-19/footer
create footer
2 parents ece2505 + 4268c6e commit d9d2f1c

File tree

10 files changed

+105
-1
lines changed

10 files changed

+105
-1
lines changed
454 Bytes
Loading
720 Bytes
Loading

public/social-networks/twitter.png

582 Bytes
Loading

src/app/app.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
<div class="page">
1111
<app-header></app-header>
1212
<router-outlet></router-outlet>
13+
<div class="push-footer"></div>
14+
<app-footer></app-footer>
1315
</div>
1416
<!--</div>-->

src/app/app.component.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
.page {
22
background-color: var(--background-color-light);
3+
display: flex;
4+
flex-direction: column;
5+
min-height: 100vh;
6+
7+
.push-footer {
8+
flex-grow: 1;
9+
}
310
}

src/app/app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import { Component } from '@angular/core';
22
import { ButtonModule } from 'primeng/button';
33
import { RouterOutlet } from '@angular/router';
44
import { HeaderComponent } from './features/header/header.component';
5+
import { FooterComponent } from './features/footer/footer.component';
56

67
@Component({
78
selector: 'app-root',
89
standalone: true,
9-
imports: [ButtonModule, RouterOutlet, HeaderComponent],
10+
imports: [ButtonModule, RouterOutlet, HeaderComponent, FooterComponent],
1011
templateUrl: './app.component.html',
1112
styleUrl: './app.component.scss',
1213
})
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<footer>
2+
<div class="links-asso">
3+
<p>© 2025</p>
4+
<p>-</p>
5+
<p>A l’asso !</p>
6+
<p>-</p>
7+
<p>Tous droits réservés</p>
8+
<!--TODO: ajouter les liens de confidentialités, conditions générales, infos entreprises-->
9+
</div>
10+
<div class="social-networks">
11+
<button type="button" (click)="navigate('instagram')" aria-label="Instagram">
12+
<img src="/social-networks/instagram.png" alt="Instagram" />
13+
</button>
14+
<button type="button" (click)="navigate('twitter')" aria-label="Twitter">
15+
<img src="/social-networks/twitter.png" alt="Twitter" />
16+
</button>
17+
<button type="button" (click)="navigate('facebook')" aria-label="Facebook">
18+
<img src="/social-networks/facebook.png" alt="Facebook" />
19+
</button>
20+
</div>
21+
</footer>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
footer {
2+
display: flex;
3+
justify-content: space-around;
4+
background-color: var(--primary-light-color);
5+
color: var(--background-color-white);
6+
7+
.links-asso {
8+
display: flex;
9+
width: 50%;
10+
gap: 2%;
11+
}
12+
13+
.social-networks {
14+
display: flex;
15+
gap: 20%;
16+
17+
button {
18+
background: none;
19+
border: none;
20+
cursor: pointer;
21+
}
22+
23+
img {
24+
width: 25px;
25+
object-fit: contain;
26+
}
27+
}
28+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { FooterComponent } from './footer.component';
4+
5+
describe('FooterComponent', () => {
6+
let component: FooterComponent;
7+
let fixture: ComponentFixture<FooterComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [FooterComponent]
12+
})
13+
.compileComponents();
14+
15+
fixture = TestBed.createComponent(FooterComponent);
16+
component = fixture.componentInstance;
17+
fixture.detectChanges();
18+
});
19+
20+
it('should create', () => {
21+
expect(component).toBeTruthy();
22+
});
23+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-footer',
5+
imports: [],
6+
templateUrl: './footer.component.html',
7+
styleUrl: './footer.component.scss',
8+
})
9+
export class FooterComponent {
10+
navigate(socialNetwork: string): void {
11+
const urls: Record<string, string> = {
12+
instagram: 'https://www.instagram.com/',
13+
twitter: 'https://www.twitter.com/',
14+
facebook: 'https://www.facebook.com/',
15+
};
16+
17+
const url = urls[socialNetwork];
18+
if (url) {
19+
window.open(url, '_blank');
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)