Sha256: 3760a34bfafc3127a23303a555707e3005f044373d034d54a66a81fbede9eb0c

Contents?: true

Size: 864 Bytes

Versions: 24

Compression:

Stored size: 864 Bytes

Contents

class NotificationComponent < BaseComponent
  def initialize(notification: nil)
    @notification = notification
    super
  end

  erb_template <<~ERB
    <div class="notification d-flex flex-column flex-sm-row justify-content-between <%= 'unseen' if @notification.unseen? %>"
         id="<%= dom_id(@notification) %>" data-id="<%= @notification.id %>">
      <div class="pe-3">
        <%= @notification.message.html_safe %>
      </div>
      <div class="notification--time d-flex flex-column justify-content-end text-body-tertiary text-end">
        <div>
          hace
          <%= distance_of_time_in_words @notification.created_at, Time.zone.now %>
        </div>
        <div>
          <a href="javascript:void" class="link-opacity-50" data-action="notifications#markAsUnseen">Marcar como no leĆ­do</a>
        </div>
      </div>
    </div>
  ERB
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
pg_rails-7.1.11 pg_engine/app/components/notification_component.rb
pg_rails-7.1.10 pg_engine/app/components/notification_component.rb
pg_rails-7.1.9 pg_engine/app/components/notification_component.rb
pg_rails-7.1.8 pg_engine/app/components/notification_component.rb
pg_rails-7.1.7 pg_engine/app/components/notification_component.rb
pg_rails-7.1.6 pg_engine/app/components/notification_component.rb
pg_rails-7.1.5 pg_engine/app/components/notification_component.rb
pg_rails-7.1.4 pg_engine/app/components/notification_component.rb
pg_rails-7.1.3 pg_engine/app/components/notification_component.rb
pg_rails-7.1.2 pg_engine/app/components/notification_component.rb
pg_rails-7.1.1.pre.6 pg_engine/app/components/notification_component.rb
pg_rails-7.1.1.pre.5 pg_engine/app/components/notification_component.rb
pg_rails-7.1.1.pre.4 pg_engine/app/components/notification_component.rb
pg_rails-7.1.1.pre.3 pg_engine/app/components/notification_component.rb
pg_rails-7.1.1.pre.2 pg_engine/app/components/notification_component.rb
pg_rails-7.1.1.pre.1 pg_engine/app/components/notification_component.rb
pg_rails-7.1.0 pg_engine/app/components/notification_component.rb
pg_rails-7.0.8.pre.alpha.112 pg_engine/app/components/notification_component.rb
pg_rails-7.0.8.pre.alpha.111 pg_engine/app/components/notification_component.rb
pg_rails-7.0.8.pre.alpha.110 pg_engine/app/components/notification_component.rb