Hide register and login button on about when user is logged in

master
Max 5 years ago
parent 52767b0dc2
commit 3a39e0e3b3

@ -66,9 +66,11 @@
<div id="text2" style="text-align: center;">
<p class="mat-display-1">We believe, that together we can do amazing things to protect our environment and keep it
clean and green.</p>
<p class="mat-display-1">You aren't part of greenvironment yet? - join us now!</p>
<a mat-stroked-button color="primary" class="link-button" routerLink="/register">Register</a>
<br>
<a mat-stroked-button color="primary" class="link-button" routerLink="/login">Login</a>
<div *ngIf="!loggedIn">
<p class="mat-display-1">You aren't part of greenvironment yet? - join us now!</p>
<a mat-stroked-button color="primary" class="link-button" routerLink="/register">Register</a>
<br>
<a mat-stroked-button color="primary" class="link-button" routerLink="/login">Login</a>
</div>
</div>
</div>

@ -1,9 +1,10 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {Activitylist} from 'src/app/models/activity';
import {LevelList} from 'src/app/models/levellist';
import {MatSort} from '@angular/material/sort';
import {MatTableDataSource} from '@angular/material/table';
import {ActivityService} from 'src/app/services/activity/activity.service';
import { Component, OnInit, ViewChild } from '@angular/core';
import { Activitylist } from 'src/app/models/activity';
import { LevelList } from 'src/app/models/levellist';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { ActivityService } from 'src/app/services/activity/activity.service';
import { DatasharingService } from '../../services/datasharing.service';
@Component({
selector: 'app-about',
@ -11,6 +12,7 @@ import {ActivityService} from 'src/app/services/activity/activity.service';
styleUrls: ['./about.component.sass']
})
export class AboutComponent implements OnInit {
loggedIn = false;
actionlist: Activitylist = new Activitylist();
levellist: LevelList = new LevelList();
@ -19,12 +21,15 @@ export class AboutComponent implements OnInit {
displayedLevelColumns = ['level', 'name'];
levelSource = new MatTableDataSource(this.levellist.levels);
constructor(private activityService: ActivityService) {
constructor(private activityService: ActivityService, private data: DatasharingService) {
}
@ViewChild(MatSort, {static: true}) sort: MatSort;
@ViewChild(MatSort, { static: true }) sort: MatSort;
ngOnInit() {
this.data.currentUser.subscribe(user => {
this.loggedIn = user.loggedIn;
});
this.activityService.getActivities();
this.activityService.activitylist.subscribe(response => {
this.actionlist = response;

Loading…
Cancel
Save