StyledFooterComponent
This is a Ruby code snippet that defines a custom footer component called FooterComponent, which inherits from ApplicationComponent. The purpose of this component is to generate HTML content for a website's footer section. It utilizes a method called template to structure the footer's layout and content, employing several HTML elements such as 'footer', 'nav', 'h6', and 'a'. The footer is divided into three sections, each wrapped in a 'nav' tag: Services, Company, and Legal. Each section has a title ('h6') and several links ('a'), with specific classes applied for styling (e.g., 'footer-title', 'link', 'link-hover'). These links are related to the respective section's theme, like 'Branding' and 'Design' under Services, 'About us' and 'Contact' under Company, and 'Terms of use' and 'Privacy policy' under Legal. The classes assigned to the elements suggest the use of a CSS framework for styling.
# frozen_string_literal: true
class FooterComponent < ApplicationComponent
def template
footer(class: "footer p-10 bg-base-200 text-base-content") do
nav do
h6(class: "footer-title") { "Services" }
a(class: "link link-hover") { "Branding" }
a(class: "link link-hover") { "Design" }
a(class: "link link-hover") { "Marketing" }
a(class: "link link-hover") { "Advertisement" }
end
nav do
h6(class: "footer-title") { "Company" }
a(class: "link link-hover") { "About us" }
a(class: "link link-hover") { "Contact" }
a(class: "link link-hover") { "Jobs" }
a(class: "link link-hover") { "Press kit" }
end
nav do
h6(class: "footer-title") { "Legal" }
a(class: "link link-hover") { "Terms of use" }
a(class: "link link-hover") { "Privacy policy" }
a(class: "link link-hover") { "Cookie policy" }
end
end
end
end