Skip to content

Commit ddaa157

Browse files
committed
Use ion-card for consistent styling.
1 parent 230801c commit ddaa157

File tree

5 files changed

+61
-102
lines changed

5 files changed

+61
-102
lines changed

src/app/features/home/post-capture-tab/post-capture-tab.component.html

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
<div class="segments" [ngSwitch]="categories">
55
<ion-segment mode="ios" [(ngModel)]="categories">
66
<ion-segment-button value="Photo" checked>
7-
<ion-icon src="/assets/icon/apps.svg" class="series-tab-icon"></ion-icon>
7+
<ion-icon src="/assets/icon/apps.svg" class="segment"></ion-icon>
88
</ion-segment-button>
99
<ion-segment-button value="Series">
10-
<ion-icon
11-
src="/assets/icon/series.svg"
12-
class="series-tab-icon"
13-
></ion-icon>
10+
<ion-icon src="/assets/icon/series.svg" class="segment"></ion-icon>
1411
</ion-segment-button>
1512
</ion-segment>
1613
<div class="post-captures" *ngSwitchCase="'Photo'">
@@ -28,13 +25,12 @@
2825
</mat-grid-list>
2926
</div>
3027

31-
<div class="series-wrapper" *ngSwitchCase="'Series'">
32-
<div
33-
class="series-image"
28+
<div class="series" *ngSwitchCase="'Series'">
29+
<ion-card
3430
*ngFor="let series of series$ | async"
3531
[routerLink]="['series', { id: series.id, cover: series.cover_image }]"
3632
>
3733
<ion-img [src]="series.cover_image"></ion-img>
38-
</div>
34+
</ion-card>
3935
</div>
4036
</div>

src/app/features/home/post-capture-tab/post-capture-tab.component.scss

Lines changed: 34 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -15,68 +15,55 @@
1515

1616
.segments {
1717
display: flex;
18-
padding: 8px;
1918
flex-direction: column;
2019
height: 100%;
2120
}
2221

2322
ion-segment {
2423
width: 80%;
25-
margin: 0 auto 16px;
24+
margin: 8px auto;
2625
flex-shrink: 0;
27-
}
28-
29-
.post-captures {
30-
overflow: auto;
31-
}
3226

33-
mat-grid-tile {
34-
ion-img {
35-
width: 100%;
36-
height: 100%;
37-
object-fit: cover;
38-
object-position: center;
39-
overflow: hidden;
40-
border-radius: 4px;
27+
ion-icon.segment {
28+
height: 40px;
4129
}
4230
}
4331

44-
.series-tab-icon {
45-
height: 40px;
46-
}
47-
48-
.tab-content-post {
49-
height: 100%;
50-
}
32+
.post-captures {
33+
overflow: auto;
34+
padding: 8px;
5135

52-
mat-icon {
53-
color: white;
54-
z-index: 10;
55-
}
36+
mat-grid-tile {
37+
ion-img {
38+
width: 100%;
39+
height: 100%;
40+
object-fit: cover;
41+
object-position: center;
42+
overflow: hidden;
43+
border-radius: 4px;
44+
}
5645

57-
mat-icon.from-store {
58-
position: absolute;
59-
bottom: 5px;
60-
left: 5px;
61-
font-size: 20px;
62-
opacity: 90%;
46+
mat-icon.from-store {
47+
color: white;
48+
z-index: 10;
49+
position: absolute;
50+
bottom: 5px;
51+
left: 5px;
52+
font-size: 20px;
53+
opacity: 90%;
54+
}
55+
}
6356
}
6457

65-
.series-image {
66-
margin-top: 10px;
67-
margin-bottom: 20px;
68-
width: 100%;
69-
height: 300px;
70-
max-width: 500px;
71-
max-height: 300px;
72-
overflow: hidden;
73-
box-sizing: border-box;
74-
box-shadow: 4px 0 4px #a5a5a5;
75-
border-radius: 5px;
58+
.series {
59+
height: auto;
60+
overflow: auto;
7661

77-
ion-img {
78-
object-fit: cover;
79-
object-position: center;
80-
height: 100%;
62+
ion-card {
63+
ion-img {
64+
height: 300px;
65+
object-fit: cover;
66+
object-position: center;
67+
}
8168
}
8269
}

src/app/features/home/post-capture-tab/series/series.page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<div class="toolbar-spacer"></div>
66
</mat-toolbar>
77
<div class="page-content">
8-
<div class="series-image">
8+
<ion-card>
99
<ion-img [src]="cover$ | async"></ion-img>
10-
</div>
10+
</ion-card>
1111
<mat-grid-list cols="3" gutterSize="8px">
1212
<mat-grid-tile
1313
class="collection-general"
Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
1-
mat-toolbar {
2-
color: white;
3-
4-
.mat-icon {
5-
color: white;
6-
}
7-
}
8-
9-
.toolbar-spacer {
10-
flex: 1 1 auto;
11-
}
12-
13-
mat-grid-tile {
1+
ion-card {
142
ion-img {
15-
width: 100%;
16-
height: 100%;
3+
height: 300px;
174
object-fit: cover;
185
object-position: center;
19-
overflow: hidden;
20-
border-radius: 4px;
216
}
227
}
238

24-
.page-content {
25-
padding: 16px;
9+
mat-grid-list {
10+
margin: 8px;
11+
12+
mat-grid-tile {
13+
ion-img {
14+
width: 100%;
15+
height: 100%;
16+
object-fit: cover;
17+
object-position: center;
18+
overflow: hidden;
19+
border-radius: 4px;
20+
}
21+
}
2622
}
2723

2824
.collection-general {
@@ -48,22 +44,3 @@ mat-grid-tile {
4844
border-radius: 4px;
4945
background: #ffaced;
5046
}
51-
52-
.series-image {
53-
margin-top: 10px;
54-
margin-bottom: 20px;
55-
width: 100%;
56-
height: 300px;
57-
max-width: 500px;
58-
max-height: 300px;
59-
overflow: hidden;
60-
box-sizing: border-box;
61-
box-shadow: 4px 0 4px #a5a5a5;
62-
border-radius: 5px;
63-
64-
ion-img {
65-
object-fit: cover;
66-
object-position: center;
67-
height: 100%;
68-
}
69-
}

src/app/shared/services/dia-backend/series/dia-backend-series-repository.service.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// tslint:disable: no-magic-numbers
21
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
32
import { Injectable } from '@angular/core';
43
import { defer, throwError } from 'rxjs';
@@ -12,11 +11,6 @@ import { BASE_URL } from '../secret';
1211
providedIn: 'root',
1312
})
1413
export class DiaBackendSeriesRepository {
15-
constructor(
16-
private readonly httpClient: HttpClient,
17-
private readonly authService: DiaBackendAuthService
18-
) {}
19-
2014
readonly fetchSeries$ = defer(() => this.authService.getAuthHeaders()).pipe(
2115
concatMap(headers =>
2216
this.httpClient.get<PaginatedResponse<DiaBackendSeries>>(
@@ -34,6 +28,11 @@ export class DiaBackendSeriesRepository {
3428
return throwError(err);
3529
})
3630
);
31+
32+
constructor(
33+
private readonly httpClient: HttpClient,
34+
private readonly authService: DiaBackendAuthService
35+
) {}
3736
}
3837

3938
export interface DiaBackendSeries {

0 commit comments

Comments
 (0)