Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

98 change the UI of report type buttons #102

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions deployments/id/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@
"structureTypeButton": "Structural Failure"
},
"report":{
"realTypeButton": "Submit Real Disaster Report",
"trainingTypeButton": "Complete Training Exercise"
"realTypeButton": "Submit Disaster Report",
"realSubTypeButton": "Use only if you are in a disaster 🚨",
"trainingTypeButton": "Complete Training Exercise",
"trainingSubTypeButton": "Use to practice disaster reporting📝"
}
},
"visibility": {
Expand Down
4 changes: 3 additions & 1 deletion deployments/id/assets/locales/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
},
"report": {
"realTypeButton": "Laporkan Bencana",
"trainingTypeButton": " Latihan Simulasi"
"realSubTypeButton": "Gunakan saat ada bencana🚨",
"trainingTypeButton": "Latihan Simulasi",
"trainingSubTypeButton": "Gunakan saat latihan📝"
}
},
"visibility": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<div
class="report-type"
>
<button class="report-type__btn">
<button class="report-type__btn" [ngClass]="btnClasses">
{{ title }}
<div class="report-type__subtitle"> {{ subtitle }} </div>
</button>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,39 @@
cursor: pointer;

&__btn {
display: block;
color: #c34c4d;
display: grid;
margin: 20px auto 10px;
border-radius: 7.5px;
padding: 8px 6px;
min-width: 72px;
border: 1.5px solid white;
background-color: #fff;
cursor: pointer;
min-width: 30%;
line-height: 1;
font-size: 1.2rem;
font-size: 1.5rem;
filter: drop-shadow(2px 4px 6px black);
font-weight: 700;
height: 100px;
align-items: center;
}
&__subtitle {
font-size: 0.9rem;
font-weight: 100;
}
.real_btn{
background-color: rgb(204, 0, 0);
color: white;
border: none;
&__subtitle {
color: white;
}
}
.training_btn{
background-color: white;
&__subtitle {
color: black;
}
}

}

@media (max-width: 721px) and (max-height: 761px) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ import { Component, Input } from '@angular/core';
})
export class ReportTypeButtonComponent {
@Input() title: string;
@Input() subtitle: string;
@Input() btnClasses: string;
}
4 changes: 3 additions & 1 deletion src/app/routes/decks/earthquake/earthquake.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
<ng-template ngFor let-item [ngForOf]="items">
<app-report-type-button
[title]="item.title | translate"
[subtitle]="item.subtitle | translate"
(click)="onTypeSelected(item.subType)"
[btnClasses]="item.subType === 'real' ? 'real_btn' : item.subType === 'training' ? 'training_btn' : ''"
></app-report-type-button>
</ng-template>
</div>

<router-outlet>
</router-outlet>

Expand Down
3 changes: 3 additions & 0 deletions src/app/routes/decks/earthquake/earthquake.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { environment as env } from '../../../../environments/environment';
export class EarthquakeComponent implements OnInit {
items: {
title: string;
subtitle: string;
subType: 'real' | 'training';
}[];
showReportTypeButton: boolean = true
Expand Down Expand Up @@ -53,10 +54,12 @@ export class EarthquakeComponent implements OnInit {
this.items = [
{
title: 'card.type.report.realTypeButton',
subtitle: 'card.type.report.realSubTypeButton',
subType: 'real',
},
{
title: 'card.type.report.trainingTypeButton',
subtitle: 'card.type.report.trainingSubTypeButton',
subType: 'training',
},
]
Expand Down
2 changes: 2 additions & 0 deletions src/app/routes/decks/fire/fire.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<ng-template ngFor let-item [ngForOf]="items">
<app-report-type-button
[title]="item.title | translate"
[subtitle]="item.subtitle | translate"
(click)="onTypeSelected(item.subType)"
[btnClasses]="item.subType === 'real' ? 'real_btn' : item.subType === 'training' ? 'training_btn' : ''"
></app-report-type-button>
</ng-template>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/routes/decks/fire/fire.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { environment as env } from '../../../../environments/environment';
export class FireComponent implements OnInit {
items: {
title: string;
subtitle: string;
subType: 'real' | 'training';
}[];
showReportTypeButton: boolean = true
Expand Down Expand Up @@ -54,10 +55,12 @@ export class FireComponent implements OnInit {
this.items = [
{
title: 'card.type.report.realTypeButton',
subtitle: 'card.type.report.realSubTypeButton',
subType: 'real',
},
{
title: 'card.type.report.trainingTypeButton',
subtitle: 'card.type.report.trainingSubTypeButton',
subType: 'training',
},
];
Expand Down
2 changes: 2 additions & 0 deletions src/app/routes/decks/flood/flood.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
<ng-template ngFor let-item [ngForOf]="items">
<app-report-type-button
[title]="item.title | translate"
[subtitle]="item.subtitle | translate"
(click)="onTypeSelected(item.subType)"
[btnClasses]="item.subType === 'real' ? 'real_btn' : item.subType === 'training' ? 'training_btn' : ''"
></app-report-type-button>
</ng-template>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/routes/decks/flood/flood.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { environment as env } from '../../../../environments/environment';
export class FloodComponent implements OnInit {
items: {
title: string;
subtitle: string;
subType: 'real' | 'training';
}[];
showReportTypeButton: boolean = true
Expand Down Expand Up @@ -54,10 +55,12 @@ export class FloodComponent implements OnInit {
this.items = [
{
title: 'card.type.report.realTypeButton',
subtitle: 'card.type.report.realSubTypeButton',
subType: 'real',
},
{
title: 'card.type.report.trainingTypeButton',
subtitle: 'card.type.report.trainingSubTypeButton',
subType: 'training',
},
];
Expand Down
2 changes: 2 additions & 0 deletions src/app/routes/decks/haze/haze.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<ng-template ngFor let-item [ngForOf]="items">
<app-report-type-button
[title]="item.title | translate"
[subtitle]="item.subtitle | translate"
(click)="onTypeSelected(item.subType)"
[btnClasses]="item.subType === 'real' ? 'real_btn' : item.subType === 'training' ? 'training_btn' : ''"
></app-report-type-button>
</ng-template>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/routes/decks/haze/haze.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { environment as env } from '../../../../environments/environment';
export class HazeComponent implements OnInit {
items: {
title: string;
subtitle: string;
subType: 'real' | 'training';
}[];
showReportTypeButton: boolean = true
Expand Down Expand Up @@ -54,10 +55,12 @@ export class HazeComponent implements OnInit {
this.items = [
{
title: 'card.type.report.realTypeButton',
subtitle: 'card.type.report.realSubTypeButton',
subType: 'real',
},
{
title: 'card.type.report.trainingTypeButton',
subtitle: 'card.type.report.trainingSubTypeButton',
subType: 'training',
},
]
Expand Down
2 changes: 2 additions & 0 deletions src/app/routes/decks/volcano/volcano.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<ng-template ngFor let-item [ngForOf]="items">
<app-report-type-button
[title]="item.title | translate"
[subtitle]="item.subtitle | translate"
(click)="onTypeSelected(item.subType)"
[btnClasses]="item.subType === 'real' ? 'real_btn' : item.subType === 'training' ? 'training_btn' : ''"
></app-report-type-button>
</ng-template>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/routes/decks/volcano/volcano.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { environment as env } from '../../../../environments/environment';
export class VolcanoComponent implements OnInit {
items: {
title: string;
subtitle: string;
subType: 'real' | 'training';
}[];
showReportTypeButton: boolean = true
Expand Down Expand Up @@ -54,10 +55,12 @@ export class VolcanoComponent implements OnInit {
this.items = [
{
title: 'card.type.report.realTypeButton',
subtitle: 'card.type.report.realSubTypeButton',
subType: 'real',
},
{
title: 'card.type.report.trainingTypeButton',
subtitle: 'card.type.report.trainingSubTypeButton',
subType: 'training',
},
]
Expand Down
2 changes: 2 additions & 0 deletions src/app/routes/decks/wind/wind.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<ng-template ngFor let-item [ngForOf]="items">
<app-report-type-button
[title]="item.title | translate"
[subtitle]="item.subtitle | translate"
(click)="onTypeSelected(item.subType)"
[btnClasses]="item.subType === 'real' ? 'real_btn' : item.subType === 'training' ? 'training_btn' : ''"
></app-report-type-button>
</ng-template>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/routes/decks/wind/wind.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { environment as env } from '../../../../environments/environment';
export class WindComponent implements OnInit {
items: {
title: string;
subtitle: string;
subType: 'real' | 'training';
}[];
showReportTypeButton: boolean = true
Expand Down Expand Up @@ -55,10 +56,12 @@ export class WindComponent implements OnInit {
this.items = [
{
title: 'card.type.report.realTypeButton',
subtitle: 'card.type.report.realSubTypeButton',
subType: 'real',
},
{
title: 'card.type.report.trainingTypeButton',
subtitle: 'card.type.report.trainingSubTypeButton',
subType: 'training',
},
]
Expand Down