refactor(dsfr/card): rename CardComponent => CardVerticalComponent

This commit is contained in:
Colin Darie 2022-09-07 15:46:54 +02:00
parent e0a15e9821
commit c927f2c250
4 changed files with 11 additions and 14 deletions

View file

@ -1,12 +1,10 @@
class Dsfr::CardComponent < ApplicationComponent
class Dsfr::CardVerticalComponent < ApplicationComponent
renders_many :footer_buttons
private
attr_reader :title, :desc
def initialize(title: nil, desc: nil)
@title = title
@desc = desc
end
attr_reader :title, :desc
end

View file

@ -10,8 +10,7 @@
- if footer_buttons?
.fr-card__footer
.fr-btns-group.fr-btns-group--inline-reverse.fr-btns-group--inline-lg
%ul
- footer_buttons.each do |button|
%li
= button
%ul.fr-btns-group.fr-btns-group--inline-reverse.fr-btns-group--inline-lg
- footer_buttons.each do |button|
%li
= button

View file

@ -104,12 +104,12 @@
.container
.fr-grid-row.fr-grid-row--gutters.fr-py-5w
.fr-col-md-6.fr-col-12
= render Dsfr::CardComponent.new(title: "Vous êtes prêt pour dématérialiser ?", desc: "Réduisez vos temps dinstruction de 50 %") do |c|
= render Dsfr::CardVerticalComponent.new(title: "Vous êtes prêt pour dématérialiser ?", desc: "Réduisez vos temps dinstruction de 50 %") do |c|
- c.with_footer_button do
= link_to("Créer votre compte administrateur", DEMANDE_INSCRIPTION_ADMIN_PAGE_URL, class: "fr-btn", **external_link_attributes)
.fr-col-md-6.fr-col-12
= render Dsfr::CardComponent.new(title: "Vous voulez en savoir plus ?", desc: "Participez à notre prochain Webinaire") do |c|
= render Dsfr::CardVerticalComponent.new(title: "Vous voulez en savoir plus ?", desc: "Participez à notre prochain Webinaire") do |c|
- c.with_footer_button do
= link_to("Inscription à notre prochain webinanire", INSCRIPTION_WEBINAIRE_URL, class: "fr-btn", **external_link_attributes)

View file

@ -306,15 +306,15 @@
%p.empty-text-details Vous navez commencé aucune démarche pour linstant.
.container
%h1 Dsfr::CardComponent
%h1 Dsfr::CardVerticalComponent
= link_to "Documentation DSFR Carte", "https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/carte", **external_link_attributes
.fr-grid-row.fr-grid-row--gutters.fr-py-5w
.fr-col-md-6.fr-col-12
= render Dsfr::CardComponent.new(title: "Optional title", desc: "Optional description")
= render Dsfr::CardVerticalComponent.new(title: "Optional title", desc: "Optional description")
.fr-col-md-6.fr-col-12
= render Dsfr::CardComponent.new(title: "With footer buttons") do |c|
= render Dsfr::CardVerticalComponent.new(title: "With footer buttons") do |c|
- c.with_footer_button do
= link_to "Button 1", "#", class: "fr-btn", **external_link_attributes
- c.with_footer_button do