Class: Hackernews::Layouts::ApplicationLayout

Inherits:
Charming::View
  • Object
show all
Defined in:
app/views/layouts/application_layout.rb

Instance Method Summary collapse

Instance Method Details

#renderObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/views/layouts/application_layout.rb', line 6

def render
  modal = command_palette_modal

  screen_layout(background: theme.background) do
    split(narrow? ? :vertical : :horizontal, gap: 1) do
      pane(:sidebar, **sidebar_options, border: :rounded, padding: [1, 2], style: sidebar_style) do
        column(app_title, navigation, shortcuts, gap: 1)
      end

      pane(:content, grow: 1, border: :rounded, padding: [1, 2], style: content_style) do
        yield_content
      end
    end

    overlay modal if modal
  end
end