-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
desktop/src/app/components/navbar/taskbar-editor.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Component, OnInit } from '@angular/core';; | ||
import { SettingsProvider } from '../../services/settings/settings-provider'; | ||
import { AppComponent } from '../app.component'; | ||
|
||
@Component({ | ||
selector: 'taskbar-editor', | ||
templateUrl: './taskbar-editor.html' | ||
}) | ||
/** | ||
* @author Danilo Guzzo | ||
*/ | ||
|
||
export class TaskbarEditorComponent implements OnInit { | ||
public currentEditor: string; | ||
|
||
constructor( | ||
private settingsProvider: SettingsProvider, | ||
private appComponent: AppComponent | ||
) { | ||
this.currentEditor = this.settingsProvider.getSettings().username; | ||
this.settingsProvider.settingsChangesNotifications().subscribe(settings => this.currentEditor = settings.username); | ||
} | ||
public openModal = () => this.appComponent.promptEditorName(); | ||
|
||
ngOnInit() { | ||
|
||
this.currentEditor = this.settingsProvider.getSettings().username; | ||
} | ||
|
||
public getEditorName() { | ||
return this.currentEditor; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div id="editor"> | ||
<span class="mdi mdi-account-alert" *ngIf="getEditorName() === 'anonymous'"></span> | ||
<span class="mdi mdi-account-check" *ngIf="getEditorName() != 'anonymous'"></span> | ||
<a | ||
id="editor-name" | ||
class="nav-link px-2" | ||
type="button" | ||
(click)="openModal()" | ||
> | ||
{{getEditorName()}} | ||
</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
taskbar-editor { | ||
#editor { | ||
padding-right: 1rem !important; | ||
|
||
position: relative; | ||
left: 1px; | ||
height: 20px; | ||
.mdi { | ||
float: left; | ||
margin-right: 10px; | ||
} | ||
|
||
#editor-name { | ||
white-space: nowrap | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters