identity-vault/app/components/brand.rb
2025-12-17 12:23:08 -05:00

32 lines
913 B
Ruby
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class Components::Brand < Components::Base
def initialize(identity:, logo_path: nil)
@identity = identity
@logo_path = logo_path
end
def view_template
div(class: "brand") do
logo
h1 { t "brand" }
end
button id: "lightswitch", class: "lightswitch-btn", type: "button", "aria-label": "Toggle theme" do
span class: "lightswitch-moon" do
inline_icon("moon-fill", size: 16)
end
span class: "lightswitch-sun", style: "display: none;" do
inline_icon("sun", size: 16)
end
end
render Components::EnvironmentBanner.new
end
def logo
div(class: "brand-logos") do
vite_image_tag "images/hc-square.png", alt: "Hack Club logo", class: "brand-logo"
if @logo_path
span(class: "brand-plus") { "×" }
vite_image_tag @logo_path, alt: "Logo", class: "brand-logo brand-logo--custom"
end
end
end
end