Skip to content

Commit 434182e

Browse files
committed
css for snackbar and fix service
1 parent 4e0815f commit 434182e

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

src/app/shared/components/snack-bar/snackbar.component.scss

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
width: 100%;
33
height: 50px;
44
display: flex;
5-
justify-content: center; /* Center text horizontally */
6-
align-items: center; /* Center text vertically */
5+
justify-content: center;
6+
/* Center text horizontally */
7+
align-items: center;
8+
/* Center text vertically */
79
padding: 0 10px;
810
color: white;
911
}
@@ -13,16 +15,23 @@
1315
}
1416

1517
.info-snackbar {
16-
background-color: var(--num-color--primary-green); /* Info color */
18+
background-color: var(--num-color--primary-green);
19+
/* Info color */
1720
}
1821

1922
.close-icon {
20-
margin-left: auto; /* Pushes the close button to the right */
23+
margin-left: auto;
24+
/* Pushes the close button to the right */
2125
color: black;
2226
}
2327

2428
.message-display {
2529
padding-left: 13%;
2630
font-size: larger;
2731
color: rgba(171, 42, 42, 1);
32+
font-weight: 500;
33+
font-style: Medium;
34+
font-size: large;
35+
line-height: 100%;
36+
letter-spacing: 0%;
2837
}

src/app/shared/service/Snackbar/Snackbar.service.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,17 @@ export class SnackbarService {
3636

3737
constructor() {}
3838

39+
/**
40+
* @todo implement timer for retry after
41+
* @param errorCode
42+
* @param retryAfter
43+
*/
3944
public displayErrorMessage(errorCode: string, retryAfter: number = 0) {
4045
const message = `${MessageType.ERROR}.${errorCode}`;
46+
// if (retryAfter > 0) {
47+
// message += `${retryAfter}`;
48+
// this.setSnackbarTimeOut(retryAfter * 1000);
49+
// }
4150
this.activateSnackbar(message, SnackbarColor.ERROR);
4251
}
4352

@@ -56,6 +65,10 @@ export class SnackbarService {
5665
setTimeout(() => this.deactivateSnackbar(), 5000);
5766
}
5867

68+
private setSnackbarTimeOut(timeout: number = 5000) {
69+
setTimeout(() => this.deactivateSnackbar(), timeout);
70+
}
71+
5972
public deactivateSnackbar() {
6073
this.visibilitySubject.next(false);
6174
}

0 commit comments

Comments
 (0)