-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added generic modal windows for both stats and settings.
- Loading branch information
1 parent
60e6ad0
commit 3ce5749
Showing
16 changed files
with
304 additions
and
10 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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="modal-content-wrapper"> | ||
<header id="modal-header"> | ||
<h1 id="modal-title">HEADER TEXT!</h1> | ||
</header> | ||
<section id="modal-body"> | ||
<p>BODY SECTION TEXT</p> | ||
</section> | ||
<footer id="modal-footer"> | ||
<button mat-raised-button id="modal-action-button" (click)="actionFunction()">BUTTON 1</button> | ||
<button mat-raised-button id="modal-cancel-button" (click)="closeModal()">BUTTON 2</button> | ||
</footer> | ||
</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,47 @@ | ||
html, | ||
body { | ||
height: 100%; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
font-family: Arial, Helvetica, sans-serif; | ||
display: grid; | ||
justify-items: center; | ||
align-items: center; | ||
background-color: #3a3a3a; | ||
} | ||
|
||
/* Overwrite the styles of the mat-dialog-container element globally, but only for those | ||
that have an id of `modal-component` */ | ||
/* https://stackoverflow.com/a/48689004/9263761 */ | ||
mat-dialog-container#modal-component { | ||
border: 3px solid #262626; | ||
border-radius: 11px; | ||
background-color: #1a1a1a; | ||
} | ||
|
||
#modal-content-wrapper { | ||
width: 100%; | ||
height: 100%; | ||
display: grid; | ||
grid-template-rows: repeat(1fr, 3); | ||
} | ||
|
||
#modal-title { | ||
font-size: 22px; | ||
} | ||
|
||
#modal-footer { | ||
justify-self: right; | ||
align-self: center; | ||
} | ||
|
||
#modal-action-button { | ||
margin-right: 30px; | ||
background-color: #3b3b3b; | ||
} | ||
|
||
#modal-cancel-button { | ||
background-color: #4e4e4e; | ||
} |
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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { SettingsModalComponent } from './settings-modal.component'; | ||
|
||
describe('SettingsModalComponent', () => { | ||
let component: SettingsModalComponent; | ||
let fixture: ComponentFixture<SettingsModalComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ SettingsModalComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(SettingsModalComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,30 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
import { MatDialogRef } from '@angular/material/dialog'; | ||
|
||
@Component({ | ||
selector: 'app-settings-modal', | ||
templateUrl: './settings-modal.component.html', | ||
styleUrls: ['./settings-modal.component.scss'] | ||
}) | ||
|
||
export class SettingsModalComponent implements OnInit { | ||
|
||
constructor(public dialogRef: MatDialogRef<SettingsModalComponent>) { } | ||
|
||
ngOnInit() { | ||
} | ||
// When the user clicks the action button a.k.a. the logout button in the\ | ||
// modal, show an alert and followed by the closing of the modal | ||
actionFunction() { | ||
alert("You have logged out."); | ||
this.closeModal(); | ||
} | ||
|
||
// If the user clicks the cancel button a.k.a. the go back button, then\ | ||
// just close the modal | ||
closeModal() { | ||
this.dialogRef.close(); | ||
} | ||
|
||
} |
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="modal-content-wrapper"> | ||
<header id="modal-header"> | ||
<h1 id="modal-title">HEADER TEXT!</h1> | ||
</header> | ||
<section id="modal-body"> | ||
<p>BODY SECTION TEXT</p> | ||
</section> | ||
<footer id="modal-footer"> | ||
<button mat-raised-button id="modal-action-button" (click)="actionFunction()">BUTTON 1</button> | ||
<button mat-raised-button id="modal-cancel-button" (click)="closeModal()">BUTTON 2</button> | ||
</footer> | ||
</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,47 @@ | ||
html, | ||
body { | ||
height: 100%; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
font-family: Arial, Helvetica, sans-serif; | ||
display: grid; | ||
justify-items: center; | ||
align-items: center; | ||
background-color: #3a3a3a; | ||
} | ||
|
||
/* Overwrite the styles of the mat-dialog-container element globally, but only for those | ||
that have an id of `modal-component` */ | ||
/* https://stackoverflow.com/a/48689004/9263761 */ | ||
mat-dialog-container#modal-component { | ||
border: 3px solid #262626; | ||
border-radius: 11px; | ||
background-color: #1a1a1a; | ||
} | ||
|
||
#modal-content-wrapper { | ||
width: 100%; | ||
height: 100%; | ||
display: grid; | ||
grid-template-rows: repeat(1fr, 3); | ||
} | ||
|
||
#modal-title { | ||
font-size: 22px; | ||
} | ||
|
||
#modal-footer { | ||
justify-self: right; | ||
align-self: center; | ||
} | ||
|
||
#modal-action-button { | ||
margin-right: 30px; | ||
background-color: #3b3b3b; | ||
} | ||
|
||
#modal-cancel-button { | ||
background-color: #4e4e4e; | ||
} |
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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { StatsModalComponent } from './stats-modal.component'; | ||
|
||
describe('StatsModalComponent', () => { | ||
let component: StatsModalComponent; | ||
let fixture: ComponentFixture<StatsModalComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ StatsModalComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(StatsModalComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,28 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { MatDialogRef } from '@angular/material/dialog'; | ||
|
||
@Component({ | ||
selector: 'app-stats-modal', | ||
templateUrl: './stats-modal.component.html', | ||
styleUrls: ['./stats-modal.component.scss'] | ||
}) | ||
export class StatsModalComponent implements OnInit { | ||
|
||
constructor(public dialogRef: MatDialogRef<StatsModalComponent>) { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
// When the user clicks the action button a.k.a. the logout button in the\ | ||
// modal, show an alert and followed by the closing of the modal | ||
actionFunction() { | ||
alert("You have logged out."); | ||
this.closeModal(); | ||
} | ||
|
||
// If the user clicks the cancel button a.k.a. the go back button, then\ | ||
// just close the modal | ||
closeModal() { | ||
this.dialogRef.close(); | ||
} | ||
} |
Oops, something went wrong.