Sha256: 449de7ffb9bd19b1416ea70a5ac868ecb316d41e15b16736c32a51765bb05675

Contents?: true

Size: 590 Bytes

Versions: 22

Compression:

Stored size: 590 Bytes

Contents

module Spina
  module MainNavigation
    class SubNavComponent < ApplicationComponent      
      renders_one :icon
      renders_one :links
      
      def initialize(name = :content)
        @name = name
      end
      
      def active?
        helpers.admin_section == @name
      end
      
      def button_classes
        if active?
          "opacity-100"
        else
          "opacity-50"
        end
      end
      
      def ul_classes
        if active?
          "md:translate-x-20 "
        else
          "translate-x-full"
        end
      end
      
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
spina-2.12.0 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.11.0 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.10.0 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.9.1 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.9.0 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.8.1 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.8.0 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.7.0 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.6.2 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.6.1 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.6.0 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.5.0 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.4.0 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.3.5 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.3.4 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.3.3 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.3.2 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.3.1 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.3.0 app/components/spina/main_navigation/sub_nav_component.rb
spina-2.2.0 app/components/spina/main_navigation/sub_nav_component.rb