diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 9f84bd4b7..60a442ebd 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -1,8 +1,4 @@ module NotificationsHelper - def notification_tray - notification_stream_tag + notification_tray_tag - end - def notification_tag(notification, &) link_to notification.resource, id: dom_id(notification), class: "notification", data: { @@ -11,15 +7,4 @@ module NotificationsHelper notifications__readings_url_param: notification_readings_url(notification) }, & end - - private - def notification_stream_tag - turbo_stream_from Current.user, :notifications - end - - def notification_tray_tag - tag.div id: "notification-tray", class: "notification-tray", data: { turbo_permanent: true, controller: "notifications--readings" } do - turbo_frame_tag("notifications", src: notifications_path) - end - end end diff --git a/app/views/bubbles/index.html.erb b/app/views/bubbles/index.html.erb index a35ba09c9..40bc6772c 100644 --- a/app/views/bubbles/index.html.erb +++ b/app/views/bubbles/index.html.erb @@ -51,4 +51,4 @@ -<%= notification_tray %> +<%= render "notifications/tray" %> diff --git a/app/views/bubbles/show.html.erb b/app/views/bubbles/show.html.erb index 938fcd864..371600f9d 100644 --- a/app/views/bubbles/show.html.erb +++ b/app/views/bubbles/show.html.erb @@ -77,4 +77,4 @@ <%= turbo_frame_tag dom_id(@bubble, :stage_picker), src: new_bucket_bubble_stage_picker_path(@bubble.bucket, @bubble) %> -<%= notification_tray %> +<%= render "notifications/tray" %> diff --git a/app/views/buckets/index.html.erb b/app/views/buckets/index.html.erb index b53e188fd..7c2f59a91 100644 --- a/app/views/buckets/index.html.erb +++ b/app/views/buckets/index.html.erb @@ -21,4 +21,4 @@ <%= render @filters %> -<%= notification_tray %> +<%= render "notifications/tray" %> diff --git a/app/views/notifications/_tray.html.erb b/app/views/notifications/_tray.html.erb new file mode 100644 index 000000000..9b9d91c40 --- /dev/null +++ b/app/views/notifications/_tray.html.erb @@ -0,0 +1,5 @@ +<%= turbo_stream_from Current.user, :notifications %> + +<%= tag.div id: "notification-tray", class: "notification-tray", data: { turbo_permanent: true, controller: "notifications--readings" } do %> + <%= turbo_frame_tag("notifications", src: notifications_path) %> +<% end %>