Sha256: 0aa626aa90bed8110de5aa55393abb2d36418978026c22ef5f68c5259f412aa6
Contents?: true
Size: 774 Bytes
Versions: 6
Compression:
Stored size: 774 Bytes
Contents
module Coco module App module Blocks class SidebarNav < Coco::Component renders_many :actions, ->(label, href, icon:, **kwargs) do @actions_data << {label: label, href: href, icon: icon, **kwargs} end renders_many :items, ->(label, href, show_on_mobile: true, **kwargs, &block) do tag.div class: ["nav-item", ("mobile-nav-item" if show_on_mobile)] do render Coco::App::Blocks::SidebarNavItem.new( label: label, href: href, active: helpers.current_page?(href), **kwargs ), &block end end attr_reader :actions_data def initialize(**) @actions_data = [] end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems