Class: Primer::OpenProject::PageHeader::PageHeaderActionMenu
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Primer::OpenProject::PageHeader::PageHeaderActionMenu
- Defined in:
- app/components/primer/open_project/page_header.rb
Overview
A Helper class to create ActionMenus inside the PageHeader action slot
Constant Summary
Constants inherited from Component
Component::INVALID_ARIA_LABEL_TAGS
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Constants included from AttributesHelper
AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Method Summary collapse
- #before_render ⇒ Object
- #call ⇒ Object
-
#initialize(menu_arguments: {}, button_arguments: {}) ⇒ PageHeaderActionMenu
constructor
A new instance of PageHeaderActionMenu.
- #render_in(view_context, &block) ⇒ Object
Methods inherited from Component
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Methods included from AttributesHelper
#aria, #data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes
Methods included from ExperimentalSlotHelpers
Methods included from ExperimentalRenderHelpers
Constructor Details
#initialize(menu_arguments: {}, button_arguments: {}) ⇒ PageHeaderActionMenu
Returns a new instance of PageHeaderActionMenu.
263 264 265 266 |
# File 'app/components/primer/open_project/page_header.rb', line 263 def initialize(menu_arguments: {}, button_arguments: {}) @menu = Primer::Alpha::ActionMenu.new(**) @button = @menu.(icon: "triangle-down", **) end |
Instance Method Details
#before_render ⇒ Object
274 275 276 |
# File 'app/components/primer/open_project/page_header.rb', line 274 def before_render content end |
#call ⇒ Object
278 279 280 |
# File 'app/components/primer/open_project/page_header.rb', line 278 def call render(@menu) end |
#render_in(view_context, &block) ⇒ Object
268 269 270 271 272 |
# File 'app/components/primer/open_project/page_header.rb', line 268 def render_in(view_context, &block) super(view_context) do block.call(@menu, @button) end end |