Class: SolidWebUi::Ui::PageComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/solid_web_ui/ui/page_component.rb

Overview

Page chrome shared by every dashboard screen: a title, an optional nav bar (array of { label:, href:, active: }) and the page body as content.

When refresh is on (the default), the body is wrapped in a turbo-frame and the header gains the live auto-refresh controls; the bundled JS reloads that frame on the chosen interval. Pass refresh: false for a static page.

Constant Summary collapse

FRAME_ID =
"swui-refresh-frame"

Instance Method Summary collapse

Constructor Details

#initialize(title:, nav: [], refresh: true) ⇒ PageComponent

Returns a new instance of PageComponent.



14
15
16
17
18
# File 'app/components/solid_web_ui/ui/page_component.rb', line 14

def initialize(title:, nav: [], refresh: true)
  @title = title
  @nav = nav || []
  @refresh = refresh
end