Skip to content

Commit da54c6a

Browse files
committed
fix: Notification tweaks
1 parent 1777a46 commit da54c6a

File tree

3 files changed

+837
-940
lines changed

3 files changed

+837
-940
lines changed

apps/frontend/src/ui/components/overlay/notifications/NotificationComponent.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ function NotificationOverlayComponent(props: NotificationComponentProps) {
6767
return (
6868
<Show when={visible()}>
6969
<div
70-
class="flex flex-col overflow-hidden rounded-lg bg-component-bg"
70+
class="flex flex-col overflow-hidden border border-border/05 rounded-lg bg-component-bg shadow-sm active:brightness-80 hover:brightness-90"
7171
onMouseEnter={() => onEnter()}
7272
onMouseLeave={() => onLeave()}
73+
onMouseUp={() => hide()}
7374
>
7475
<div class="px-2">
7576
<NotificationPopupComponent {...props} />
@@ -112,7 +113,7 @@ function NotificationPopupComponent(props: NotificationComponentProps) {
112113
</div>
113114

114115
<Show when={props.fraction !== undefined && props.fraction !== null && !fractionEnded(props.fraction)}>
115-
<div class="h-1.5 w-full overflow-hidden rounded-full bg-brand-disabled">
116+
<div class="h-1.5 w-full overflow-hidden rounded-full bg-brand-disabled/10">
116117
<div
117118
class="h-full max-w-full min-w-0 rounded-full bg-brand transition-width"
118119
style={{

apps/frontend/src/ui/hooks/useNotifications.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ export function NotificationProvider(props: ParentProps) {
1818
let unlisten: UnlistenFn | undefined;
1919

2020
onMount(() => {
21+
document.addEventListener('keypress', (e) => {
22+
if (e.key === 'n')
23+
setNotifications(notifications => ({
24+
...notifications,
25+
[Math.random().toString()]: {
26+
title: 'Test',
27+
message: 'This is a test notification',
28+
},
29+
}));
30+
});
31+
2132
events.ingressPayload.listen((e) => {
2233
setNotifications(notifications => ({
2334
...notifications,

0 commit comments

Comments
 (0)