This commit is contained in:
kevinpauer 2022-04-20 11:19:48 +02:00
parent ac4c59bbf8
commit c7734368e3
9 changed files with 115 additions and 21 deletions

View File

@ -3,24 +3,23 @@
<span class="example-spacer"></span> <span class="example-spacer"></span>
<button <button
mat-icon-button mat-icon-button
class="example-icon favorite-icon"
aria-label="Example icon-button with heart icon" aria-label="Example icon-button with heart icon"
[matMenuTriggerFor]="menu" routerLink="/profile"
> >
<mat-icon>settings</mat-icon> <mat-icon>account_circle</mat-icon>
</button>
<button
mat-icon-button
class="example-icon favorite-icon"
routerLink="/settings"
>
<mat-icon>ballot</mat-icon>
</button>
<button
mat-icon-button
aria-label="Example icon-button with heart icon"
(click)="logout()"
>
<mat-icon>logout</mat-icon>
</button> </button>
<mat-menu #menu="matMenu">
<button mat-menu-item routerLink="/profile">
<mat-icon>account_circle</mat-icon>
<span>Profile</span>
</button>
<button mat-menu-item routerLink="/settings">
<mat-icon>ballot</mat-icon>
<span>Bot Settings</span>
</button>
<button mat-menu-item (click)="logout()">
<mat-icon>logout</mat-icon>
<span>Logout</span>
</button>
</mat-menu>
</mat-toolbar> </mat-toolbar>

View File

@ -1,7 +1,7 @@
<div class="containeer"> <div class="containeer">
<h1 mat-dialog-title>Aktion bestätigen</h1> <h1 mat-dialog-title>Confirm Action</h1>
<div mat-dialog-content class="content"> <div mat-dialog-content class="content">
<span>Sind sie sicher, dass sie diese Handlung abschließen wollen?</span> <span>Are you sure, that you want to continue?</span>
</div> </div>
<div mat-dialog-actions class="form-group footer-buttons"> <div mat-dialog-actions class="form-group footer-buttons">
<div class="inner"> <div class="inner">
@ -21,7 +21,7 @@
(click)="confirm()" (click)="confirm()"
[mat-dialog-close]="true" [mat-dialog-close]="true"
> >
Ok Yes
</button> </button>
</div> </div>
</div> </div>

View File

@ -0,0 +1,23 @@
<div class="containeer">
<h1 mat-dialog-title>How to add your Telegram account</h1>
<div mat-dialog-content class="content">
<span
>To get your UserId, you have to write "/id" or "/auth" to the bot on
Telegram. (<a href="https://t.me/projektaktienbot)"
>https://t.me/projektaktienbot)</a
>)</span
>
</div>
<div mat-dialog-actions class="form-group footer-buttons">
<div class="inner">
<button
id="okButton"
class="btn btn-secondary btn-block"
(click)="close()"
[mat-dialog-close]="true"
>
Ok
</button>
</div>
</div>
</div>

View File

@ -0,0 +1,18 @@
.footer-buttons {
width: 100%;
text-align: center;
}
.spacer {
flex-grow: 1;
width: 5%;
}
.inner {
display: inline-block;
width: 100%;
}
.content {
height: 80%;
}

View File

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

View File

@ -0,0 +1,14 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-help-dialog',
templateUrl: './help-dialog.component.html',
styleUrls: ['./help-dialog.component.scss'],
})
export class HelpDialogComponent implements OnInit {
constructor() {}
ngOnInit(): void {}
close() {}
}

View File

@ -97,7 +97,9 @@
</mat-grid-tile> </mat-grid-tile>
<mat-grid-tile> <mat-grid-tile>
<mat-card class="card"> <mat-card class="card">
<mat-card-title class="card-title">Add Telegram Id</mat-card-title> <mat-card-title class="card-title">
<span>Connect Telegram Account</span>
</mat-card-title>
<mat-card-content> <mat-card-content>
<form <form
name="form" name="form"
@ -129,6 +131,9 @@
</button> </button>
</div> </div>
</form> </form>
<button class="btn btn-secondary btn-block" (click)="openHelp()">
Help
</button>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</mat-grid-tile> </mat-grid-tile>

View File

@ -3,6 +3,7 @@ import { FormControl, PatternValidator, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { ProfileService } from 'src/app/Services/profile.service'; import { ProfileService } from 'src/app/Services/profile.service';
import { ConfirmationDialogComponent } from './confirmation-dialog/confirmation-dialog.component'; import { ConfirmationDialogComponent } from './confirmation-dialog/confirmation-dialog.component';
import { HelpDialogComponent } from './help-dialog/help-dialog.component';
@Component({ @Component({
selector: 'app-profile', selector: 'app-profile',
@ -75,4 +76,11 @@ export class ProfileComponent implements OnInit {
} }
}); });
} }
openHelp() {
const dialogRef = this.dialog.open(HelpDialogComponent, {
width: '50vw',
height: '20vh',
});
}
} }

View File

@ -25,6 +25,7 @@ import { ProfileComponent } from './Views/profile/profile.component';
import { BotSettingsComponent } from './Views/bot-settings/bot-settings.component'; import { BotSettingsComponent } from './Views/bot-settings/bot-settings.component';
import { UserDialogComponent } from './Views/dashboard/user-dialog/user-dialog.component'; import { UserDialogComponent } from './Views/dashboard/user-dialog/user-dialog.component';
import { ConfirmationDialogComponent } from './Views/profile/confirmation-dialog/confirmation-dialog.component'; import { ConfirmationDialogComponent } from './Views/profile/confirmation-dialog/confirmation-dialog.component';
import { HelpDialogComponent } from './Views/profile/help-dialog/help-dialog.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -37,6 +38,7 @@ import { ConfirmationDialogComponent } from './Views/profile/confirmation-dialog
BotSettingsComponent, BotSettingsComponent,
UserDialogComponent, UserDialogComponent,
ConfirmationDialogComponent, ConfirmationDialogComponent,
HelpDialogComponent,
], ],
imports: [ imports: [
BrowserModule, BrowserModule,