chore: mark preferred domain to new domain when closing notice

This commit is contained in:
Colin Darie 2024-03-18 19:31:57 +01:00
parent a16f88f8af
commit 2f4444bd5e
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
9 changed files with 41 additions and 5 deletions

View file

@ -2,11 +2,18 @@
class Dsfr::NoticeComponent < ApplicationComponent
renders_one :title
def initialize(closable: false)
attr_reader :data_attributes
def initialize(closable: false, data_attributes: {})
@closable = closable
@data_attributes = data_attributes
end
def closable?
!!@closable
end
def notice_data_attributes
{ "data-dsfr-header-target": "notice" }.merge(data_attributes)
end
end