Class: Anchor::LoadingIndicatorComponent
- Defined in:
- app/components/anchor/loading_indicator_component.rb
Constant Summary collapse
- VARIANT_MAPPING =
{ sm: "w-4 h-4 border-[1.5px]", md: "w-6 h-6 border-2", lg: "w-12 h-12 border-4", }.freeze
- VARIANT_DEFAULT =
:md- VARIANT_OPTIONS =
VARIANT_MAPPING.keys
Instance Method Summary collapse
-
#initialize(variant: VARIANT_DEFAULT, **kwargs) ⇒ LoadingIndicatorComponent
constructor
A new instance of LoadingIndicatorComponent.
Methods inherited from Component
Methods included from ViewHelper
Methods included from FetchOrFallbackHelper
Constructor Details
#initialize(variant: VARIANT_DEFAULT, **kwargs) ⇒ LoadingIndicatorComponent
Returns a new instance of LoadingIndicatorComponent.
11 12 13 14 15 16 17 |
# File 'app/components/anchor/loading_indicator_component.rb', line 11 def initialize(variant: VARIANT_DEFAULT, **kwargs) @variant = VARIANT_MAPPING[ fetch_or_fallback(VARIANT_OPTIONS, variant, VARIANT_DEFAULT) ] super end |