August 2025
Intermediate to advanced
294 pages
6h 59m
English
The notification bell in the main navigation bar is implemented in its own LiveView module, rendered from the user_info function component in the TunezWeb.Layouts module:
| | <%= if @current_user do %> |
| | {live_render(@socket, TunezWeb.NotificationsLive, sticky: true, |
| | id: :notifications_container)} |
| | <% # ... %> |
This NotificationsLive liveview is marked as sticky, meaning it won’t need to reload as we navigate around and use the app. It’ll stay open on the server, alongside the page liveview we’re currently using such as TunezWeb.Artists.IndexLive, and each new page liveview will connect to it to render it.
Inside TunezWeb.NotificationsLive, in lib/tunez_web/live/notifications_live.ex ...
Read now
Unlock full access