create component for sidemenu and add locales for raw text
This commit is contained in:
parent
4a2982dc37
commit
a01564adcd
13 changed files with 126 additions and 76 deletions
15
app/components/dsfr/sidemenu_component.rb
Normal file
15
app/components/dsfr/sidemenu_component.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
class Dsfr::SidemenuComponent < ApplicationComponent
|
||||
renders_many :links, "LinkComponent"
|
||||
|
||||
class LinkComponent < ApplicationComponent
|
||||
attr_reader :name, :url
|
||||
def initialize(name:, url:)
|
||||
@name = name
|
||||
@url = url
|
||||
end
|
||||
end
|
||||
|
||||
def active?(url)
|
||||
current_page?(url)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue