Skip to content

Commit b49beb4

Browse files
Ismaestroiramos
authored and
iramos
committed
feat(footer): added footer component and refactor other things
1 parent a6cd095 commit b49beb4

File tree

7 files changed

+47
-25
lines changed

7 files changed

+47
-25
lines changed

src/app/app.component.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
<div class="container">
1+
<div class="container main-container">
22
<toh-nav [title]="'tourOfHeroes' | translate"></toh-nav>
33
<router-outlet></router-outlet>
44
</div>
5-
<footer class="footer">
6-
<div class="container">
7-
<span class="text-muted">{{ 'tourOfHeroes' | translate }} @2016.</span>
8-
</div>
9-
</footer>
5+
<toh-footer></toh-footer>

src/app/core/core.module.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import {LoggerService} from './logger.service';
1111
import {HeroesModule} from '../heroes/heroes.module';
1212
import {HeroRoutingModule} from '../heroes/heroes-routing.module';
1313

14-
import {NavComponent} from './nav/nav.component';
14+
import {NavComponent} from './nav/nav.component';
15+
import {FooterComponent} from "./footer/footer.component";
1516

1617

1718
@NgModule({
@@ -27,10 +28,12 @@ import {NavComponent} from './nav/nav.component';
2728
}),
2829
],
2930
exports: [
30-
NavComponent
31+
NavComponent,
32+
FooterComponent
3133
],
3234
declarations: [
33-
NavComponent
35+
NavComponent,
36+
FooterComponent
3437
],
3538
providers: [
3639
LoggerService
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<footer>
2+
<div class="container center">
3+
<span class="text-muted">{{ 'tourOfHeroes' | translate }} @2016.</span>
4+
</div>
5+
</footer>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
:host(toh-footer) {
2+
position: absolute;
3+
bottom: 0;
4+
width: 100%;
5+
height: 60px;
6+
line-height: 60px;
7+
background-color: #f5f5f5;
8+
padding: 0 6em 0 6em;
9+
10+
.container {
11+
padding: 0;
12+
}
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import {Component} from '@angular/core';
2+
3+
@Component({
4+
selector: 'toh-footer',
5+
templateUrl: './footer.component.html',
6+
styleUrls: ['./footer.component.scss']
7+
})
8+
9+
export class FooterComponent {
10+
}

src/app/core/nav/nav.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
</ul>
1111
</div>
1212
<div class="dropdown">
13-
<a class="btn btn-secondary dropdown-toggle" id="dropdownMenuLink" data-toggle="dropdown"
13+
<a class="btn btn-secondary dropdown-toggle" id="languagesDropdown" data-toggle="dropdown"
1414
aria-haspopup="true" aria-expanded="false">
1515
<i class="fa fa-globe" aria-hidden="true"></i> {{ 'language' | translate }}
1616
</a>
17-
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
17+
<div class="dropdown-menu" aria-labelledby="languagesDropdown">
1818
<a class="dropdown-item" (click)="changeLanguage('en')">{{ 'english' | translate }}</a>
1919
<a class="dropdown-item" (click)="changeLanguage('es')">{{ 'spanish' | translate }}</a>
2020
</div>

src/assets/css/styles.css

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,22 @@ body {
1818
padding: 0;
1919
width: 100%;
2020
margin: 0;
21+
overflow: hidden;
2122
}
2223

2324
.container .container {
2425
width: 80%;
2526
margin: 0 auto;
2627
}
2728

29+
.main-container {
30+
margin-bottom: 5em;
31+
}
32+
33+
.center {
34+
text-align: center;
35+
}
36+
2837
h2 {
2938
color: #444;
3039
font-weight: lighter;
@@ -37,17 +46,3 @@ h3 {
3746
button {
3847
cursor: pointer !important;
3948
}
40-
41-
.footer {
42-
position: absolute;
43-
bottom: 0;
44-
width: 100%;
45-
height: 60px;
46-
line-height: 60px;
47-
background-color: #f5f5f5;
48-
padding: 0 6em 0 6em;
49-
}
50-
51-
.footer > .container {
52-
padding: 0;
53-
}

0 commit comments

Comments
 (0)