Class: Polaris::Frame::SaveBarComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/polaris/frame/save_bar_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(message:, flush: false, full_width: false, logo: nil, **system_arguments) ⇒ SaveBarComponent

Returns a new instance of SaveBarComponent.



7
8
9
10
11
12
13
# File 'app/components/polaris/frame/save_bar_component.rb', line 7

def initialize(message:, flush: false, full_width: false, logo: nil, **system_arguments)
  @message = message
  @flush = flush
  @full_width = full_width
  @logo = .is_a?(Hash) ? Polaris::Logo.new(**) : 
  @system_arguments = system_arguments
end

Instance Method Details

#content_classesObject



25
26
27
28
29
30
# File 'app/components/polaris/frame/save_bar_component.rb', line 25

def content_classes
  class_names(
    "Polaris-Frame-ContextualSaveBar__Contents",
    "Polaris-Frame-ContextualSaveBar--fullWidth": @full_width
  )
end

#system_argumentsObject



15
16
17
18
19
20
21
22
23
# File 'app/components/polaris/frame/save_bar_component.rb', line 15

def system_arguments
  @system_arguments.tap do |opts|
    opts[:tag] = "div"
    opts[:classes] = class_names(
      @system_arguments[:classes],
      "Polaris-Frame-ContextualSaveBar"
    )
  end
end