7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/components/spark/nav/toggle_component.rb', line 7
def render
root_attr type: "button", id: @id || unique_id
aria_attr hidden: true
data_attr nav_toggle: "#{target}"
content_tag(:button, tag_attrs) do
concat content_tag(:span, text, class: join_class("text")) if text
if icon == 'nav-menu'
concat content_tag(:span, class: join_class("icon-wrapper")) {
content_tag(:span, nil, class: join_class("menu-icon"))
}
else
concat content_tag(:span, class: join_class("icon")) {
@view.use_svg(icon, width: '12px', class: join_class("svg")) if icon
}
end
end
end
|