A partial is clearer than a helper here

This commit is contained in:
Kevin McConnell
2025-01-10 17:37:54 +00:00
parent 10c7b61af9
commit febcb6c344
5 changed files with 8 additions and 18 deletions
-15
View File
@@ -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
+1 -1
View File
@@ -51,4 +51,4 @@
</ul>
</section>
<%= notification_tray %>
<%= render "notifications/tray" %>
+1 -1
View File
@@ -77,4 +77,4 @@
<%= turbo_frame_tag dom_id(@bubble, :stage_picker), src: new_bucket_bubble_stage_picker_path(@bubble.bucket, @bubble) %>
</div>
<%= notification_tray %>
<%= render "notifications/tray" %>
+1 -1
View File
@@ -21,4 +21,4 @@
<%= render @filters %>
</div>
<%= notification_tray %>
<%= render "notifications/tray" %>
+5
View File
@@ -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 %>