Class: Spina::Pro::Messages::MessageComponent
- Inherits:
-
ApplicationComponent
- Object
- ApplicationComponent
- Spina::Pro::Messages::MessageComponent
- Defined in:
- app/components/spina/pro/messages/message_component.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #button_classes ⇒ Object
- #image_classes ⇒ Object
-
#initialize(message) ⇒ MessageComponent
constructor
A new instance of MessageComponent.
- #unread? ⇒ Boolean
Constructor Details
#initialize(message) ⇒ MessageComponent
Returns a new instance of MessageComponent.
7 8 9 |
# File 'app/components/spina/pro/messages/message_component.rb', line 7 def initialize() @message = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'app/components/spina/pro/messages/message_component.rb', line 5 def @message end |
Instance Method Details
#button_classes ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/components/spina/pro/messages/message_component.rb', line 19 def if unread? "border-b border-gray-200 flex items-center justify-between space-x-6 px-2 pr-4 py-2 bg-white hover:bg-gray-100 w-full text-left font-semibold shadow-sm relative" else "border-b border-gray-200 flex items-center justify-between space-x-6 px-2 pr-4 py-2 bg-gray-50 hover:bg-gray-100 w-full text-left font-normal" end end |
#image_classes ⇒ Object
15 16 17 |
# File 'app/components/spina/pro/messages/message_component.rb', line 15 def image_classes "rounded-lg w-10 h-10 mr-3" end |
#unread? ⇒ Boolean
11 12 13 |
# File 'app/components/spina/pro/messages/message_component.rb', line 11 def unread? .unread? end |