2017-12-14 17:43:57 +01:00
|
|
|
import { Component, OnInit, Input } from '@angular/core';
|
2017-12-20 15:11:41 +01:00
|
|
|
import { Router } from '@angular/router';
|
2018-08-27 17:09:33 +02:00
|
|
|
import { AuthService } from '../../../services/auth/auth.service';
|
2017-12-14 17:43:57 +01:00
|
|
|
|
|
|
|
@Component({
|
2018-07-23 17:56:09 +02:00
|
|
|
selector: 'app-figurecard',
|
|
|
|
templateUrl: './figurecard.component.html',
|
2018-08-30 13:09:36 +02:00
|
|
|
styleUrls: ['./figurecard.component.scss']
|
2017-12-14 17:43:57 +01:00
|
|
|
})
|
|
|
|
export class FigurecardComponent implements OnInit {
|
2018-07-23 17:56:09 +02:00
|
|
|
@Input() headerIcon: string;
|
|
|
|
@Input() category: string;
|
|
|
|
@Input() title: string;
|
|
|
|
@Input() footerIcon: string;
|
|
|
|
@Input() footContent: string;
|
|
|
|
@Input() linearColor: string;
|
|
|
|
@Input() boxShadow: string;
|
|
|
|
@Input() routelLink: string;
|
|
|
|
@Input() hasFootContent = true;
|
2018-08-24 17:21:02 +02:00
|
|
|
@Input() buttonTitle: string;
|
|
|
|
@Input() buttonRedirectLink: string;
|
2017-12-20 15:11:41 +01:00
|
|
|
|
2018-10-05 08:56:50 +02:00
|
|
|
constructor(private router: Router, private authService: AuthService) { }
|
2017-12-14 17:43:57 +01:00
|
|
|
|
2018-07-23 17:56:09 +02:00
|
|
|
ngOnInit() {
|
|
|
|
}
|
2017-12-14 17:43:57 +01:00
|
|
|
|
2018-07-23 17:56:09 +02:00
|
|
|
navigateToUrl() {
|
2018-10-05 08:56:50 +02:00
|
|
|
if (!this.isAuthenticated()) { return; }
|
2018-07-23 17:56:09 +02:00
|
|
|
this.router.navigate([this.routelLink]);
|
2018-10-05 08:56:50 +02:00
|
|
|
}
|
2017-12-20 15:11:41 +01:00
|
|
|
|
2018-10-05 08:56:50 +02:00
|
|
|
createNew() {
|
|
|
|
this.router.navigate([this.buttonRedirectLink]);
|
|
|
|
}
|
2017-12-20 15:11:41 +01:00
|
|
|
|
2018-10-05 08:56:50 +02:00
|
|
|
isAuthenticated() {
|
|
|
|
return this.authService.current() != null;
|
|
|
|
}
|
2018-08-27 17:09:33 +02:00
|
|
|
|
2017-12-14 17:43:57 +01:00
|
|
|
}
|