Class: Tramway::Chats::Messages::ContainerComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Tramway::Chats::Messages::ContainerComponent
- Defined in:
- app/components/tramway/chats/messages/container_component.rb
Overview
Renders a message container with alignment and color styles.
Constant Summary
Constants included from Helpers::ViewsHelper
Helpers::ViewsHelper::FORM_SIZES
Instance Method Summary collapse
Methods included from Helpers::ViewsHelper
#tramway_back_button, #tramway_badge, #tramway_button, #tramway_cell, #tramway_chat, #tramway_container, #tramway_flash, #tramway_form_for, #tramway_header, #tramway_main_container, #tramway_row, #tramway_table, #tramway_title
Methods included from Helpers::ComponentHelper
Methods included from Helpers::DecorateHelper
Instance Method Details
#color_classes ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'app/components/tramway/chats/messages/container_component.rb', line 21 def color_classes case position.to_sym when :left %w[bg-gray-800 rounded-tl-md] when :right %w[bg-blue-600 rounded-tr-md] end.join(' ') end |
#position_classes ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/components/tramway/chats/messages/container_component.rb', line 12 def position_classes case position.to_sym when :left %w[items-start] when :right %w[items-end] end.join(' ') end |