diff --git a/frontend/src/styles/banners.scss b/frontend/src/styles/banners.scss index 7f7a089bb..f913bf66c 100644 --- a/frontend/src/styles/banners.scss +++ b/frontend/src/styles/banners.scss @@ -3,7 +3,8 @@ width: 100%; z-index: 1000; transition: opacity 0.25s; - .banner { + .banner, + .psa { background: var(--sub-color); color: var(--bg-color); justify-content: center; diff --git a/frontend/src/ts/controllers/account-controller.ts b/frontend/src/ts/controllers/account-controller.ts index 868d0af1e..849590f39 100644 --- a/frontend/src/ts/controllers/account-controller.ts +++ b/frontend/src/ts/controllers/account-controller.ts @@ -148,7 +148,7 @@ async function getDataAndInit(): Promise { }); if (snapshot.needsToChangeName) { - Notifications.addBanner( + Notifications.addPSA( "You need to update your account name. Click here to change it and learn more about why.", -1, undefined, diff --git a/frontend/src/ts/elements/notifications.ts b/frontend/src/ts/elements/notifications.ts index e2f6ee819..6b08ccc0d 100644 --- a/frontend/src/ts/elements/notifications.ts +++ b/frontend/src/ts/elements/notifications.ts @@ -13,9 +13,10 @@ function updateMargin(): void { let visibleStickyNotifications = 0; let id = 0; +type NotificationType = "notification" | "banner" | "psa"; class Notification { id: number; - type: string; + type: NotificationType; message: string; level: number; important: boolean; @@ -24,7 +25,7 @@ class Notification { customIcon?: string; closeCallback: () => void; constructor( - type: string, + type: NotificationType, message: string, level: number, important: boolean | undefined, @@ -152,7 +153,7 @@ class Notification { $(`#notificationCenter .notif[id='${this.id}']`).on("hover", () => { $(`#notificationCenter .notif[id='${this.id}']`).toggleClass("hover"); }); - } else if (this.type === "banner") { + } else if (this.type === "banner" || this.type === "psa") { let leftside = `
${icon}
`; let withImage = false; @@ -162,7 +163,7 @@ class Notification { } $("#bannerCenter").prepend(` -