Skip to content

Commit 7a3956d

Browse files
authored
(feat) help message footer with configurable contactEmail (#396)
* remove bannerColor getter as it's not used (banner color set by css) * Add a help message footer with configurable contactEmail
1 parent 05967a6 commit 7a3956d

File tree

5 files changed

+28
-15
lines changed

5 files changed

+28
-15
lines changed

src/app/app-config.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export class AppConfig {
77
production = true;
88
statusMessage = "";
99
statusCode: "INFO" | "WARN" | "NONE" = "NONE";
10+
contactEmail = "";
1011
}
1112

1213
export const APP_DI_CONFIG: AppConfig = {
@@ -15,6 +16,7 @@ export const APP_DI_CONFIG: AppConfig = {
1516
statusCode: (["INFO", "WARN", "NONE"].includes(environment["statusCode"])
1617
? environment["statusCode"]
1718
: "NONE") as "INFO" | "WARN" | "NONE",
19+
contactEmail: environment["contactEmail"] || "",
1820
};
1921

2022
@NgModule({

src/app/app.component.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212

1313
<router-outlet></router-outlet>
1414

15-
<mat-toolbar class="footer" *ngIf="config.showLogoBanner">
16-
<img src="../assets/{{ config.logoBanner }}" width="{{ config.logoWidth }}" alt="logo_banner" />
17-
</mat-toolbar>
15+
<footer class="footer">
16+
<mat-toolbar class="logo-banner" *ngIf="config.showLogoBanner">
17+
<img src="../assets/{{ config.logoBanner }}" width="{{ config.logoWidth }}" alt="logo_banner" />
18+
</mat-toolbar>
19+
20+
<address *ngIf="appConfig.contactEmail">
21+
If you have any questions or need help, please contact <a href="mailto:{{ appConfig.contactEmail }}">{{
22+
appConfig.contactEmail }}</a>.
23+
</address>
24+
</footer>

src/app/app.component.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
/* AppComponent's private CSS styles */
2+
:host {
3+
display: flex;
4+
flex-direction: column;
5+
min-height: 100vh;
6+
}
27

38
.header {
49
position: sticky;
@@ -7,11 +12,21 @@
712
}
813

914
.footer {
15+
margin-top: auto;
16+
}
17+
18+
.logo-banner {
1019
height: 77px;
1120
justify-content: center;
1221
background-color: var(--theme-primary-default-contrast);
1322
}
1423

24+
address {
25+
font-size: 16px;
26+
padding: 0.5em;
27+
background-color: whitesmoke;
28+
}
29+
1530
.spacer {
1631
flex: 1 1 auto;
1732
text-align: left;

src/app/shared/modules/status-message/status-banner/status-banner.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<mat-toolbar [color]="bannerColor" [class]='["toolbar", "toolbar-" + appConfig.statusCode]'>
1+
<mat-toolbar [class]='["toolbar", "toolbar-" + appConfig.statusCode]'>
22
<span [innerHTML]="appConfig.statusMessage" class="status-message"></span>
33
<span class="spacer"></span>
44
<button mat-icon-button aria-label="Dismiss" (click)="onDismiss()">

src/app/shared/modules/status-message/status-banner/status-banner.component.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,4 @@ export class StatusBannerComponent {
1414
onDismiss() {
1515
this.dismiss.emit();
1616
}
17-
18-
get bannerColor() {
19-
switch (this.appConfig.statusCode) {
20-
case "INFO":
21-
return "accent";
22-
case "WARN":
23-
return "warn";
24-
default:
25-
return "";
26-
}
27-
}
2817
}

0 commit comments

Comments
 (0)