Class: Oversee::Dashboard::Header
- Inherits:
-
Base
- Object
- Base
- Oversee::Dashboard::Header
- Defined in:
- app/components/oversee/dashboard/header.rb
Instance Attribute Summary collapse
-
#return_path ⇒ Object
readonly
Returns the value of attribute return_path.
-
#show_back_button ⇒ Object
readonly
Returns the value of attribute show_back_button.
-
#subtitle ⇒ Object
readonly
Returns the value of attribute subtitle.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title: nil, subtitle: nil, return_path: nil, show_back_button: true) ⇒ Header
constructor
A new instance of Header.
- #left ⇒ Object
- #right ⇒ Object
- #separator ⇒ Object
- #view_template ⇒ Object
Constructor Details
#initialize(title: nil, subtitle: nil, return_path: nil, show_back_button: true) ⇒ Header
Returns a new instance of Header.
7 8 9 10 11 12 |
# File 'app/components/oversee/dashboard/header.rb', line 7 def initialize(title: nil, subtitle: nil, return_path: nil, show_back_button: true) @title = title || "Dashboard" @subtitle = subtitle || "Manage your account" @return_path = return_path @show_back_button = end |
Instance Attribute Details
#return_path ⇒ Object (readonly)
Returns the value of attribute return_path.
4 5 6 |
# File 'app/components/oversee/dashboard/header.rb', line 4 def return_path @return_path end |
#show_back_button ⇒ Object (readonly)
Returns the value of attribute show_back_button.
5 6 7 |
# File 'app/components/oversee/dashboard/header.rb', line 5 def @show_back_button end |
#subtitle ⇒ Object (readonly)
Returns the value of attribute subtitle.
3 4 5 |
# File 'app/components/oversee/dashboard/header.rb', line 3 def subtitle @subtitle end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
2 3 4 |
# File 'app/components/oversee/dashboard/header.rb', line 2 def title @title end |
Instance Method Details
#left ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/components/oversee/dashboard/header.rb', line 26 def left(&) div(class: "flex items-center gap-2") do if h3(class: "text-lg font-medium text-gray-900") { title } if title.present? yield if block_given? end end |
#right ⇒ Object
34 35 36 |
# File 'app/components/oversee/dashboard/header.rb', line 34 def right(&) div(class: "flex items-center gap-4", &) end |
#separator ⇒ Object
38 39 40 |
# File 'app/components/oversee/dashboard/header.rb', line 38 def separator render Phlex::Icons::Iconoir::Slash.new(class: "size-4 text-gray-300", stroke_width: 1.75) end |
#view_template ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/components/oversee/dashboard/header.rb', line 14 def view_template(&) div(class: "min-h-10 flex items-center justify-between") do if block_given? yield(self) else left right end end end |