Closed adipasquale closed 1 year ago
I created 3 subcomponents :
ToolLinkComponent
DirectLinkComponent
DirectLinkDropdownComponent
I also used a polymorphic slot for direct_links with the types option, cf viewcomponent doc
This allows calling :
c.with_direct_link_simple title: "thing", path: "#here"
c.with_direct_link_dropdown title: "other thing" do |cc| ...
and preserve the order when displaying them in the component view with direct_links.each do |direct_link|
direct_links.each do |direct_link|
The suffix _simple is quite unfortunate but I could not find a way to not have this suffix for the default case.
_simple
@freesteph I’m going to need to merge this to be able to use it in a new PR in collectif-objets because I'm already depending on the next PR with the Tabs
Looking
I created 3 subcomponents :
ToolLinkComponent
DirectLinkComponent
DirectLinkDropdownComponent
(that is composed of many of the previous one)I also used a polymorphic slot for direct_links with the types option, cf viewcomponent doc
This allows calling :
c.with_direct_link_simple title: "thing", path: "#here"
c.with_direct_link_dropdown title: "other thing" do |cc| ...
and preserve the order when displaying them in the component view with
direct_links.each do |direct_link|
The suffix
_simple
is quite unfortunate but I could not find a way to not have this suffix for the default case.