Extract banner to a component

This commit is contained in:
Javi Martín
2021-01-14 15:19:41 +01:00
parent 885a9ad765
commit 957a73f837
4 changed files with 21 additions and 10 deletions

View File

@@ -0,0 +1,16 @@
class Shared::BannerComponent < ApplicationComponent
attr_reader :banner
def initialize(banner)
@banner = banner
end
private
def link
link_to banner.target_url do
tag.h2(banner.title, style: "color:#{banner.font_color}") +
tag.h3(banner.description, style: "color:#{banner.font_color}")
end
end
end