Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions frontend/src/main/scala/crestedbutte/laminar/Components.scala
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@ object Components {
),
),
),
// Notification permission button at the bottom
div(
cls := "notification-permission-container",
styleAttr := "position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; width: auto;",
child <-- Signal.fromValue(()).map { _ =>
if (dom.Notification.permission == "granted") {
div() // Don't show button if permission already granted
} else {
button(
idAttr := ElementNames.Notifications.requestPermission,
cls := "button",
styleAttr := "padding: 0.75rem 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.3);",
"Enable Notifications",
onClick --> Experimental.Notifications.clickObserver,
)
}
},
),
)
}

Expand Down