Files
fizzy/app/views/notifications/_tray.html.erb
T
2025-05-20 13:50:53 -05:00

28 lines
1.3 KiB
Plaintext

<%= turbo_stream_from Current.user, :notifications %>
<dialog class="tray tray--notifications"
data-controller="dialog" data-dialog-modal-value="false" data-dialog-target="dialog"
data-action="keydown.esc->dialog#close:stop click@document->dialog#closeOnClickOutside">
<%= turbo_frame_tag "notifications", src: tray_notifications_path, refresh: "morph" %>
<%= link_to notifications_path, class: "tray__overflow", data: { action: "click->dialog#close" } do %>
+ More…
<% end %>
<div class="tray__actions">
<%= button_to read_all_notifications_path,
class: "tray__notification-read_action btn btn--reversed fill-transparent borderless flex-item-justify-start shadow txt-xx-small",
data: { action: "click->dialog#close", turbo_frame: "notifications" } do %>
<%= icon_tag "check" %> <span class="for-screen-reader">Mark all read</span>
<% end %>
<%= link_to tag.span("Notifications"), notifications_path,
class: "btn btn--reversed borderless fill-transparent translucent shadow center txt-uppercase txt-x-small",
data: { action: "click->dialog#close" } %>
<span class="btn btn--placeholder txt-xx-small borderless"></span>
</div>
<button class="tray__expander" data-action="dialog#toggle" aria-label="Expand notifications stack"></button>
</dialog>