Sha256: b47f7d8d5573a5186b1681ffafb19d74c5f1745f05651cf0fe0baacf231f7299

Contents?: true

Size: 955 Bytes

Versions: 7

Compression:

Stored size: 955 Bytes

Contents

# frozen_string_literal: true

module Ariadne
  # Add a general description of component here
  # Add additional usage considerations or best practices that may aid the user to use the component correctly.
  # @accessibility Add any accessibility considerations
  class MainComponent < Ariadne::Component
    DEFAULT_CLASSES = "ariadne-flex-auto"

    # @example Default
    #
    #   <%= render(Ariadne::MainComponent.new) { "Example" } %>
    #
    # @param classes [String] <%= link_to_classes_docs %>
    # @param attributes [Hash] <%= link_to_attributes_docs %>
    def initialize(classes: "", attributes: {})
      @tag = :main
      @classes = class_names(
        DEFAULT_CLASSES,
        classes,
      )

      @attributes = attributes
    end

    def call
      render(Ariadne::BaseComponent.new(tag: @tag, classes: @classes, attributes: @attributes)) do
        render(Ariadne::ContainerComponent.new) { content }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.14 app/components/ariadne/main_component.rb
ariadne_view_components-0.0.14-x86_64-linux app/components/ariadne/main_component.rb
ariadne_view_components-0.0.14-x86_64-darwin app/components/ariadne/main_component.rb
ariadne_view_components-0.0.14-x64-mingw32 app/components/ariadne/main_component.rb
ariadne_view_components-0.0.14-x64-mingw-ucrt app/components/ariadne/main_component.rb
ariadne_view_components-0.0.14-arm64-darwin app/components/ariadne/main_component.rb
ariadne_view_components-0.0.14-aarch64-linux app/components/ariadne/main_component.rb