Sha256: 9bd4c1628585e2dff794a3e04722ef330f9f11cdf7c39ee509d607bf7fd9fcd3

Contents?: true

Size: 846 Bytes

Versions: 82

Compression:

Stored size: 846 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbHashtag
    class Hashtag
      include Playbook::Props

      partial "pb_hashtag/hashtag"

      prop :text
      prop :dark, type: Playbook::Props::Boolean, default: false
      prop :type, type: Playbook::Props::Enum,
                  values: %w[default project home appointment],
                  default: "default"
      prop :url

      def classname
        generate_classname("pb_hastag_kit", dark_class)
      end

      def hashtag_text
        type_text + text
      end

    private

      def dark_class
        dark ? "dark" : nil
      end

      def type_text
        if type === "home"
          "H#"
        elsif type === "project"
          "P#"
        elsif type === "appointment"
          "A#"
        else
          "#"
        end
      end
    end
  end
end

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
playbook_ui-5.2.0.pre.alpha11 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.5.1.pre.alpha4 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.5.1.pre.alpha3 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.5.1.pre.alpha2 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.5.1.pre.alpha1 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.2.0.pre.alpha10 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.5.1 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.5.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.5.0.pre.alpha1 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.2.0.pre.alpha9 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.2.0.pre.alpha8 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.2.0.pre.alpha7 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.3.0.pre.alpha1 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.4.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.2.0.pre.alpha6 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.2.0.pre.alpha5 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.3.0 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.2.0.pre.alpha4 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.2.0.pre.alpha3 app/pb_kits/playbook/pb_hashtag/hashtag.rb
playbook_ui-5.2.0.pre.alpha2 app/pb_kits/playbook/pb_hashtag/hashtag.rb