Sha256: 8b6cda6a526ba97fd287df6efe720c6388b3a4531860a32c604831f308198ae5

Contents?: true

Size: 461 Bytes

Versions: 8

Compression:

Stored size: 461 Bytes

Contents

# frozen_string_literal: true

module Primer
  class LinkComponent < Primer::Component
    def initialize(href:, muted: false, **kwargs)
      @kwargs = kwargs
      @kwargs[:tag] = :a
      @kwargs[:href] = href
      @kwargs[:classes] = class_names(
        @kwargs[:classes],
        "muted-link" => fetch_or_fallback([true, false], muted, false)
      )
    end

    def call
      render(Primer::BaseComponent.new(**@kwargs)) { content }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
primer_view_components-0.0.10 app/components/primer/link_component.rb
primer_view_components-0.0.9 app/components/primer/link_component.rb
primer_view_components-0.0.8 app/components/primer/link_component.rb
primer_view_components-0.0.7 app/components/primer/link_component.rb
primer_view_components-0.0.6 app/components/primer/link_component.rb
primer_view_components-0.0.5 app/components/primer/link_component.rb
primer_view_components-0.0.4 app/components/primer/link_component.rb
primer_view_components-0.0.3 app/components/primer/link_component.rb