🎨 style on mobile for nav, finish button hover

This commit is contained in:
Tykayn 2021-12-02 16:09:36 +01:00 committed by tykayn
parent 0cb295cce0
commit 3b7b21defa
7 changed files with 39 additions and 23 deletions

View File

@ -84,7 +84,6 @@
[next_step_number]="pollService.step_current + 1" [next_step_number]="pollService.step_current + 1"
[previous_step_number]="pollService.step_current - 1" [previous_step_number]="pollService.step_current - 1"
[is_finish_step]="true" [is_finish_step]="true"
[endAction]="createPoll"
></app-nav-steps> ></app-nav-steps>
</div> </div>
</div> </div>

View File

@ -13,14 +13,4 @@ export class StepSevenComponent implements OnInit {
} }
ngOnInit(): void {} ngOnInit(): void {}
createPoll() {
this.pollService.createPoll().then(
(resp) => {
this.router.navigate(['administration/success']);
},
(err) => {
console.error('oops err', err);
}
);
}
} }

View File

@ -15,7 +15,7 @@
class="button is-fullwidth" class="button is-fullwidth"
[ngClass]="{ 'is-finish': is_finish_step, 'is-primary': !is_finish_step }" [ngClass]="{ 'is-finish': is_finish_step, 'is-primary': !is_finish_step }"
[routerLink]="['/administration/step/' + next_step_number]" [routerLink]="['/administration/step/' + next_step_number]"
(click)="is_finish_step ? runEndAction() : null" (click)="runEndAction()"
> >
<span *ngIf="is_finish_step"> <span *ngIf="is_finish_step">
<i class="fa fa-save"></i> <i class="fa fa-save"></i>

View File

@ -1,4 +1,6 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { PollService } from '../../../core/services/poll.service';
@Component({ @Component({
selector: 'app-nav-steps', selector: 'app-nav-steps',
@ -11,19 +13,30 @@ export class NavStepsComponent implements OnInit {
@Input() @Input()
previous_step_number = 1; previous_step_number = 1;
@Input() @Input()
next_step_number = 1; next_step_number = 2;
@Input() @Input()
display_previous_button = true; display_previous_button = true;
@Input() @Input()
is_finish_step = false; is_finish_step = false;
@Input()
endAction: Function;
constructor() {} constructor(private router: Router, public pollService: PollService) {}
ngOnInit(): void {} ngOnInit(): void {}
runEndAction() { runEndAction() {
return this.endAction(); if (this.is_finish_step) {
this.createPoll();
}
}
createPoll() {
this.pollService.createPoll().then(
(resp) => {
this.router.navigate(['administration/success']);
},
(err) => {
console.error('oops err', err);
}
);
} }
} }

View File

@ -58,10 +58,10 @@
{{ pollService.form.value.title }} {{ pollService.form.value.title }}
</h2> </h2>
<div class="columns"> <div class="columns">
<div class="column"> <div class="column is-half">
<h3 class="step-counter-text">Étape {{ step_current }} sur {{ step_max }}</h3> <h3 class="step-counter-text">Étape {{ step_current }} sur {{ step_max }}</h3>
</div> </div>
<div class="column is-narrow has-text-right"> <div class="column is-half has-text-right">
<a class="cancel-button" (click)="showCancelDialog()"> Annuler <i class="fa fa-times"></i> </a> <a class="cancel-button" (click)="showCancelDialog()"> Annuler <i class="fa fa-times"></i> </a>
</div> </div>
</div> </div>

View File

@ -6,13 +6,19 @@
background: $white; background: $white;
height: 6em; height: 6em;
a {
@extend .clickable;
&:hover {
color: $secondary_color;
}
}
.columns, .columns,
.column { .column {
padding-bottom: 0; padding-bottom: 0;
} }
.step-bar-container { .step-bar-container {
margin: 1rem 0 0; margin: 0;
height: 0.6em; height: 0.6em;
display: inline-block; display: inline-block;
min-width: 1px; min-width: 1px;
@ -52,11 +58,15 @@
} }
.step-info { .step-info {
padding: 0.85rem; padding: 0.85rem 0.85rem 2rem;
background: $white;
i {
margin-left: 1ch;
}
} }
.step-title-poll { .step-title-poll {
font-size: 0.85rem !important; font-size: 0.85rem;
color: $d-neutral !important; color: $d-neutral;
margin-bottom: 0rem; margin-bottom: 0rem;
} }

View File

@ -14,4 +14,8 @@
.is-finish { .is-finish {
background: $success_color; background: $success_color;
color: $white; color: $white;
&:hover {
background: mix($success_color, $white);
color: $font_color;
}
} }