Sha256: f70c48853d161299b4f47786a6e0667bdbcbfb17b653f991da69cdc68711c8b9

Contents?: true

Size: 428 Bytes

Versions: 8

Compression:

Stored size: 428 Bytes

Contents

module Spina
  module UserInterface
    class TabLinkComponent < ApplicationComponent
      def initialize(name = nil, url = nil, active: false)
        url = name if url.nil?
        @url = url
        @name = name
        @active = active
      end

      def css_classes
        if @active
          "cursor-default text-gray-900 bg-spina-dark bg-opacity-10"
        else
          ""
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
spina-2.18.0 app/components/spina/user_interface/tab_link_component.rb
spina-2.17.0 app/components/spina/user_interface/tab_link_component.rb
spina-2.16.0 app/components/spina/user_interface/tab_link_component.rb
spina-2.15.1 app/components/spina/user_interface/tab_link_component.rb
spina-2.15.0 app/components/spina/user_interface/tab_link_component.rb
spina-2.14.0 app/components/spina/user_interface/tab_link_component.rb
spina-2.13.1 app/components/spina/user_interface/tab_link_component.rb
spina-2.13.0 app/components/spina/user_interface/tab_link_component.rb