Skip to content

Commit

Permalink
Limit in app notification preview to 2, added wip hover to expand
Browse files Browse the repository at this point in the history
  • Loading branch information
SupertigerDev committed Sep 21, 2024
1 parent 132fb79 commit f90765c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,33 @@
}
.container {
display: flex;
overflow: hidden;
flex: 1;
flex-direction: column;
width: 100%;
max-width: 500px;
height: 46px;
padding: 4px;
padding: 8px;
padding-bottom: 2px;
margin: 4px;
border: solid 1px rgba(255, 255, 255, 0.2);
border-radius: 8px;
background-color: var(--pane-color);

user-select: none;
transition: 0.2s;
pointer-events: all;
gap: 4px;

&:hover {
height: auto;
.markup {
display: block;
overflow: initial;
flex: 1;
text-overflow: initial;
white-space: pre-line;
line-break: anywhere;
}
}
}

.infoContainer {
Expand Down Expand Up @@ -56,6 +70,7 @@
display: flex;
overflow: hidden;
flex-direction: column;
gap: 2px;
}
.body {
display: flex;
Expand All @@ -78,6 +93,7 @@
}

.avatar {
align-self: flex-start;
margin-right: 4px;
margin-left: 4px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const [notifications, setNotifications] = createStore<
>([]);

const pushNotification = (notification: InAppPreviewNotification) => {
if (notifications.length >= 2) {
setNotifications(reconcile([notifications[0]!, notification]));
}
setNotifications([...notifications, notification]);
};
const removeNotification = (notification: InAppPreviewNotification) => {
Expand Down

0 comments on commit f90765c

Please sign in to comment.