Skip to content

Commit

Permalink
fix: putting notification sticky in viewport (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaile authored Feb 23, 2024
1 parent 23194be commit 5faf41d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/NotificationHandler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ notificationEngine.$onAction(({ name, after }) => {
</script>

<template>
<div class="flex flex-col items-end space-y-4 overflow-hidden p-4">
<div class="flex flex-col items-end space-y-4 overflow-hidden">
<TransitionGroup>
<div
v-for="[id, notification] in notificationEngine.notifications"
:key="id"
class="flex items-start gap-x-4 rounded-lg bg-white p-4 shadow-lg dark:bg-gray-800"
class="mt-4 flex items-start gap-x-4 rounded-lg bg-white p-4 shadow-lg dark:bg-gray-800"
>
<div
v-if="notification.type == 'success'"
Expand Down
6 changes: 4 additions & 2 deletions src/views/BaseTemplate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ function handleLogout() {
</div>
<main class="relative grow bg-gray-50 p-6 dark:bg-gray-900">
<!-- Notification handler -->
<div class="absolute right-0 top-0 z-20 max-w-lg">
<NotificationHandler />
<div class="sticky top-0 z-20">
<div class="absolute right-0 top-0 max-w-lg">
<NotificationHandler />
</div>
</div>
<RouterView />
</main>
Expand Down

0 comments on commit 5faf41d

Please sign in to comment.