Class: SolidusAdmin::Layout::SkipLink::Component

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/solidus_admin/layout/skip_link/component.rb

Instance Method Summary collapse

Constructor Details

#initialize(href:) ⇒ Component

Returns a new instance of Component.



4
5
6
# File 'app/components/solidus_admin/layout/skip_link/component.rb', line 4

def initialize(href:)
  @href = href
end

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/components/solidus_admin/layout/skip_link/component.rb', line 8

def call
  link_to t(".skip_link"),
          @href,
          class: %{
            sr-only
            focus:not-sr-only
            inline-block
            focus:p-2
            focus:absolute
            font-normal text-sm
            text-white
            bg-black
          }
end