Class: NitroKit::AuthShell

Inherits:
Component
  • Object
show all
Defined in:
app/components/nitro_kit/auth_shell.rb

Constant Summary

Constants inherited from Component

Component::ADDITIVE_DATA_ATTRIBUTES, Component::COMPONENT_OWNED_DATA_ATTRIBUTES, Component::FORBIDDEN_ATTRIBUTES, Component::RESERVED_DATA_ATTRIBUTES

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, html: {}, aria: {}, data: {}, desperately_need_a_class: nil) ⇒ AuthShell

Returns a new instance of AuthShell.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/components/nitro_kit/auth_shell.rb', line 5

def initialize(
  id: nil,
  html: {},
  aria: {},
  data: {},
  desperately_need_a_class: nil
)
  super(
    component: :auth_shell,
    attributes: { id: }.compact,
    html:,
    aria:,
    data:,
    desperately_need_a_class:
  )
end

Instance Method Details

#view_templateObject

Raises:

  • (ArgumentError)


22
23
24
25
26
27
28
29
30
31
32
# File 'app/components/nitro_kit/auth_shell.rb', line 22

def view_template
  raise ArgumentError, "NitroKit::AuthShell requires a content block" unless block_given?

  main(**root_attributes) do
    render NitroKit::Container.new(size: :md) do
      render NitroKit::Flex.new(dir: :col, gap: 6, align: :stretch) do
        yield
      end
    end
  end
end