demarches-normaliennes/app/components/dsfr/sidemenu_component.rb
2024-08-22 09:26:48 +02:00

18 lines
369 B
Ruby

# frozen_string_literal: true
class Dsfr::SidemenuComponent < ApplicationComponent
renders_many :links, "LinkComponent"
class LinkComponent < ApplicationComponent
attr_reader :name, :url, :icon
def initialize(name:, url:, icon: nil)
@name = name
@url = url
@icon = icon
end
end
def active?(url)
current_page?(url)
end
end