Class: Trek::Dashboard::TileComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/trek/dashboard/tile_component.rb

Instance Method Summary collapse

Methods included from StimulusHelpers

#stimulus_action, #stimulus_class, #stimulus_class_hash, #stimulus_class_key, #stimulus_target, #stimulus_target_hash, #stimulus_target_key, #stimulus_value, #stimulus_value_hash, #stimulus_value_key

Methods included from CssClassesHelpers

#class_for, #class_names_for, #root_class

Methods included from IdentifierHelper

#identifier

Instance Method Details

#classesObject



17
18
19
20
21
22
# File 'app/components/trek/dashboard/tile_component.rb', line 17

def classes
  class_names(
    root_class,
    class_for("color-#{color}")
  )
end

#formatted_textObject



24
25
26
27
28
# File 'app/components/trek/dashboard/tile_component.rb', line 24

def formatted_text
  # rubocop:disable Rails/OutputSafety
  text.gsub("\n", "#{tag.br} ")&.html_safe
  # rubocop:enable Rails/OutputSafety
end

#render?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/components/trek/dashboard/tile_component.rb', line 13

def render?
  allowed_to
end