aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util/src/components/GlobalNotificationBanner.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/web-util/src/components/GlobalNotificationBanner.tsx')
-rw-r--r--packages/web-util/src/components/GlobalNotificationBanner.tsx11
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/web-util/src/components/GlobalNotificationBanner.tsx b/packages/web-util/src/components/GlobalNotificationBanner.tsx
index c8049acc3..b0a06f7e1 100644
--- a/packages/web-util/src/components/GlobalNotificationBanner.tsx
+++ b/packages/web-util/src/components/GlobalNotificationBanner.tsx
@@ -1,28 +1,27 @@
import { Fragment, VNode, h } from "preact"
-import { Attention, useNotifications } from "../index.browser.js"
+import { Attention, GLOBAL_NOTIFICATION_TIMEOUT, useNotifications } from "../index.browser.js"
export function GlobalNotificationsBanner(): VNode {
const notifs = useNotifications()
if (notifs.length === 0) return <Fragment />
- return <div class="fixed z-20 w-full p-4"> {
+ return <Fragment> {
notifs.map(n => {
switch (n.message.type) {
case "error":
return <Attention type="danger" title={n.message.title} onClose={() => {
n.remove()
- }}>
+ }} timeout={GLOBAL_NOTIFICATION_TIMEOUT}>
{n.message.description &&
<div class="mt-2 text-sm text-red-700">
{n.message.description}
</div>
}
- {/* <MaybeShowDebugInfo info={n.message.debug} /> */}
</Attention>
case "info":
return <Attention type="success" title={n.message.title} onClose={() => {
n.remove();
- }} />
+ }} timeout={GLOBAL_NOTIFICATION_TIMEOUT} />
}
})}
- </div>
+ </Fragment>
}