Class: Maquina::Navbar::Title

Inherits:
Phlex::HTML
  • Object
show all
Includes:
ApplicationView
Defined in:
app/views/maquina/navbar/title.rb

Instance Method Summary collapse

Methods included from ApplicationView

#attribute_human_name, #button_to, #image_tag, #link_to, #model_human_name, #svg_icon

Constructor Details

#initialize(brand_icon: "") ⇒ Title

Returns a new instance of Title.



8
9
10
# File 'app/views/maquina/navbar/title.rb', line 8

def initialize(brand_icon: "")
  @brand_icon = brand_icon
end

Instance Method Details

#view_templateObject



12
13
14
15
16
17
18
19
# File 'app/views/maquina/navbar/title.rb', line 12

def view_template
  div class: "flex-shrink-0 flex items-center" do
    if @brand_icon.present?
      img(src: @brand_icon, class: "hidden lg:block mx-auto h-8 w-auto")
      img(src: @brand_icon, class: "block lg:hidden mx-auto h-8 w-auto")
    end
  end
end