mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
This commit does several changes: - it moves the ownership of the last message info to the channel instead of storing it on the message, it avoids the need to iterate over every messages - makes an optimistic update of the last read message id - adds a spec to confirm this behavior
43 lines
1.4 KiB
Handlebars
43 lines
1.4 KiB
Handlebars
<StyleguideExample @title="<ChatMessage>">
|
|
<Styleguide::Component>
|
|
<ChatMessage @message={{this.message}} @context="channel" />
|
|
</Styleguide::Component>
|
|
|
|
<Styleguide::Controls>
|
|
<Styleguide::Controls::Row @name="Deleted">
|
|
<DToggleSwitch
|
|
@state={{not (not this.message.deletedAt)}}
|
|
{{on "click" this.toggleDeleted}}
|
|
/>
|
|
</Styleguide::Controls::Row>
|
|
<Styleguide::Controls::Row @name="Bookmark">
|
|
<DToggleSwitch
|
|
@state={{not (not this.message.bookmark)}}
|
|
{{on "click" this.toggleBookmarked}}
|
|
/>
|
|
</Styleguide::Controls::Row>
|
|
<Styleguide::Controls::Row @name="Thread">
|
|
<DToggleSwitch
|
|
@state={{not (not this.message.thread)}}
|
|
{{on "click" this.toggleThread}}
|
|
/>
|
|
</Styleguide::Controls::Row>
|
|
<Styleguide::Controls::Row @name="Reactions">
|
|
<DToggleSwitch
|
|
@state={{not (not this.message.reactions)}}
|
|
{{on "click" this.toggleReaction}}
|
|
/>
|
|
</Styleguide::Controls::Row>
|
|
<Styleguide::Controls::Row @name="Upload">
|
|
<DToggleSwitch
|
|
@state={{not (not this.message.uploads)}}
|
|
{{on "click" this.toggleUpload}}
|
|
/>
|
|
</Styleguide::Controls::Row>
|
|
<Styleguide::Controls::Row @name="Message">
|
|
<textarea
|
|
{{on "input" this.updateMessage}}
|
|
>{{this.message.message}}</textarea>
|
|
</Styleguide::Controls::Row>
|
|
</Styleguide::Controls>
|
|
</StyleguideExample> |