A partial is clearer than a helper here
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -51,4 +51,4 @@
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<%= notification_tray %>
|
||||
<%= render "notifications/tray" %>
|
||||
|
||||
@@ -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" %>
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
<%= render @filters %>
|
||||
</div>
|
||||
|
||||
<%= notification_tray %>
|
||||
<%= render "notifications/tray" %>
|
||||
|
||||
@@ -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 %>
|
||||
Reference in New Issue
Block a user