42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { Component, OnInit, Input } from '@angular/core';
|
|
import { Router } from '@angular/router';
|
|
import { AuthService } from '../../../services/auth/auth.service';
|
|
|
|
@Component({
|
|
selector: 'app-figurecard',
|
|
templateUrl: './figurecard.component.html',
|
|
styleUrls: ['./figurecard.component.scss']
|
|
})
|
|
export class FigurecardComponent implements OnInit {
|
|
@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;
|
|
@Input() buttonTitle: string;
|
|
@Input() buttonRedirectLink: string;
|
|
|
|
constructor(private router: Router,private authService: AuthService) { }
|
|
|
|
ngOnInit() {
|
|
}
|
|
|
|
navigateToUrl() {
|
|
if(!this.isAuthenticated()) return;
|
|
this.router.navigate([this.routelLink]);
|
|
}
|
|
|
|
createNew(){
|
|
this.router.navigate([this.buttonRedirectLink]);
|
|
}
|
|
|
|
isAuthenticated(){
|
|
return this.authService.current() != null;
|
|
}
|
|
|
|
}
|