Add back button
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit

This commit is contained in:
Willem Dantuma 2021-01-27 07:08:31 +01:00
parent a082967c69
commit ce9c72016d
5 changed files with 62 additions and 1 deletions

View File

@ -56,6 +56,7 @@ import { SecureOAuthStorage} from './shared/secureOAuthStorage';
import { GradientComponent } from './components/gradient/gradient.component';
import { GradientSelectComponent } from './components/gradient-select/gradient-select.component';
import { AppMenuComponent } from './components/app-menu/app-menu.component';
import { BackButtonComponent } from './components/back-button/back-button.component';
export {
SafePipe,
@ -128,7 +129,8 @@ export {
UserMenuComponent,
GradientComponent,
GradientSelectComponent,
AppMenuComponent
AppMenuComponent,
BackButtonComponent
],
exports: [
NgbModule,

View File

@ -0,0 +1,4 @@
<div class="back-button">
<i class="fal fa-arrow-left"></i> <span i18n="@FmBackButton">Back</span>
</div>

View File

@ -0,0 +1,12 @@
@import "../../../../node_modules/bootstrap";
.back-button {
cursor: default;
color: $primary;
display: inline;
}
.back-button:hover {
cursor: pointer;
color: $secondary;
}

View File

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BackButtonComponent } from './back-button.component';
describe('BackButtonComponent', () => {
let component: BackButtonComponent;
let fixture: ComponentFixture<BackButtonComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ BackButtonComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(BackButtonComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,18 @@
import {Component, HostListener} from '@angular/core';
import {Location} from "@angular/common";
@Component({
selector: 'fm-back-button',
templateUrl: './back-button.component.html',
styleUrls: ['./back-button.component.scss']
})
export class BackButtonComponent {
@HostListener('click')
onBackClicked() {
this.location.back();
}
constructor(private location: Location) { }
}