Class: Polaris::Frame::SaveBarComponent
- Inherits:
-
Component
- Object
- Component
- Polaris::Frame::SaveBarComponent
- Defined in:
- app/components/polaris/frame/save_bar_component.rb
Instance Method Summary collapse
- #content_classes ⇒ Object
-
#initialize(message:, flush: false, full_width: false, logo: nil, **system_arguments) ⇒ SaveBarComponent
constructor
A new instance of SaveBarComponent.
- #system_arguments ⇒ Object
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 = @flush = flush @full_width = full_width @logo = logo.is_a?(Hash) ? Polaris::Logo.new(**logo) : logo @system_arguments = system_arguments end |
Instance Method Details
#content_classes ⇒ Object
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_arguments ⇒ Object
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 |