Class: InnerPlan::Tasks::Form::ItemComponent
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- InnerPlan::Tasks::Form::ItemComponent
- Defined in:
- app/components/inner_plan/tasks/form/item_component.rb
Instance Method Summary collapse
-
#initialize(icon:, title: nil) ⇒ ItemComponent
constructor
A new instance of ItemComponent.
- #template(&content) ⇒ Object
Constructor Details
#initialize(icon:, title: nil) ⇒ ItemComponent
Returns a new instance of ItemComponent.
3 4 5 6 |
# File 'app/components/inner_plan/tasks/form/item_component.rb', line 3 def initialize(icon:, title: nil) @icon = icon @title = title end |
Instance Method Details
#template(&content) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/components/inner_plan/tasks/form/item_component.rb', line 8 def template(&content) div(class: "d-flex mb-4") do div(class: "me-3 text-body-tertiary", style: "margin-top:-.2 rem") do render(@icon.new(width: 24, height: 24)) end div(class: "pe-4 w-100") do h6 { @title } render content end end end |