You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**(7)**`messages-loaded` must be set to `true` when all messages of a conversation have been loaded. Meaning the user cannot scroll on top to load more paginated messages
213
215
214
-
**(8)**`menu-actions` can be used to display your own buttons when clicking the vertical dots icon inside a room.<br>
216
+
**(8)**`room-actions` can be used to display your own buttons when clicking the dropdown icon of each room inside the rooms list.<br>
217
+
You can then use the [room-action-handler](#events-api) event to call your own action after clicking a button. Ex:
218
+
219
+
```javascript
220
+
menu-actions="[
221
+
{
222
+
name: 'archiveRoom',
223
+
title: 'Archive Room'
224
+
}
225
+
]"
226
+
```
227
+
228
+
**(9)**`menu-actions` can be used to display your own buttons when clicking the vertical dots icon inside a room.<br>
215
229
You can then use the [menu-action-handler](#events-api) event to call your own action after clicking a button. Ex:
216
230
217
231
```javascript
@@ -231,7 +245,7 @@ menu-actions="[
231
245
]"
232
246
```
233
247
234
-
**(9)**`message-actions` can be used to display your own buttons when clicking the dropdown icon inside a message.<br>
248
+
**(10)**`message-actions` can be used to display your own buttons when clicking the dropdown icon inside a message.<br>
235
249
You can then use the [message-action-handler](#events-api) event to call your own action after clicking a button. Ex:
236
250
237
251
```javascript
@@ -271,11 +285,11 @@ messageActions="[
271
285
]"
272
286
```
273
287
274
-
**(10)**`show-new-messages-divider` can be used to show/hide the blue line divider between seen and unseen messages.
288
+
**(11)**`show-new-messages-divider` can be used to show/hide the blue line divider between seen and unseen messages.
275
289
276
-
**(11)**`show-footer` can be used to hide the room footer. For example to prevent users to send any message or media.
290
+
**(12)**`show-footer` can be used to hide the room footer. For example to prevent users to send any message or media.
277
291
278
-
**(12)**`text-messages` can be used to replace default i18n texts. Ex:
292
+
**(13)**`text-messages` can be used to replace default i18n texts. Ex:
279
293
280
294
```javascript
281
295
text-messages="{
@@ -293,7 +307,7 @@ text-messages="{
293
307
}"
294
308
```
295
309
296
-
**(13)**`text-formatting` can be used to add text formatting. Currently, bold, italic, strikethrough, underline, inline code and multiline code formatting are available and can be used in conjonction. You can disable text formatting by passing the prop as `:textFormatting="false"`.
310
+
**(14)**`text-formatting` can be used to add text formatting. Currently, bold, italic, strikethrough, underline, inline code and multiline code formatting are available and can be used in conjonction. You can disable text formatting by passing the prop as `:textFormatting="false"`.
|`delete-message`|`{ roomId, messageId }`| Deleted a message |
475
489
|`open-file`|`{ message, action }`| Clicked to view or download a file |
476
490
|`open-user-tag`(3) |`{ user }`| Clicked on a user tag inside a message |
477
491
|`add-room`| - | Clicked on the plus icon next to searchbar |
478
-
|`menu-action-handler`(4) |`{ roomId, action }`| Clicked on the vertical dots icon inside a room |
479
-
|`message-action-handler`(5) |`{ roomId, action, message }`| Clicked on the dropdown icon inside a message |
492
+
|`room-action-handler`(4) |`{ roomId, action }`| Clicked on the vertical dots icon inside a room |
493
+
|`menu-action-handler`(5) |`{ roomId, action }`| Clicked on the vertical dots icon inside a room |
494
+
|`message-action-handler`(6) |`{ roomId, action, message }`| Clicked on the dropdown icon inside a message |
480
495
|`send-message-reaction`|`{ roomId, messageId, reaction, remove }`| Clicked on the emoji icon inside a message |
481
496
|`room-info`|`room`| Clicked the room header bar |
482
497
|`toggle-rooms-list`|`{ opened }`| Clicked on the toggle icon inside a room header |
483
-
|`textarea-action-handler`(6) |`{ roomId, message }`| Clicked on custom icon inside the footer |
498
+
|`textarea-action-handler`(7) |`{ roomId, message }`| Clicked on custom icon inside the footer |
484
499
|`typing-message`|`{ message, roomId }`| Started typing a message |
485
500
486
501
**(1)**`fetch-messages` is triggered every time a room is opened. If the room is opened for the first time, the `options` param will hold `reset: true`.<br>
@@ -497,7 +512,20 @@ messages="[
497
512
This will make the tag clickable inside a message. Ex: [message tag content](#messages-collection-inside-a-room-document)<br>
498
513
`send-message` and `edit-message` events will handle that pattern for you and pass it in the `content` param.
499
514
500
-
**(4)**`menu-action-handler` is the result of the [`menu-actions`](#props-api) prop.<br>
515
+
**(4)**`room-action-handler` is the result of the [`room-actions`](#props-api) prop.<br>
516
+
When clicking a button from your `room-actions` array, `room-action-handler` will give you the name of the button that was click.
517
+
Then you can do whatever you want with it. Ex:
518
+
519
+
```javascript
520
+
menuActionHandler({ roomId, action }) {
521
+
switch (action.name) {
522
+
case'archiveRoom':
523
+
// call a method to archive the room
524
+
}
525
+
}
526
+
```
527
+
528
+
**(5)**`menu-action-handler` is the result of the [`menu-actions`](#props-api) prop.<br>
501
529
When clicking a button from your `menu-actions` array, `menu-action-handler` will give you the name of the button that was click.
**(5)**`message-action-handler` is the result of the `message-actions` prop.<br>
518
-
When clicking a message menu button from your `message-actions` array, `message-action-handler` will give you the name of the button that was click and the corresponding message data.
545
+
**(6)**`message-action-handler` is the result of the [`message-actions`](#props-api) prop.<br>
546
+
When clicking a button from your `message-actions` array, `message-action-handler` will give you the name of the button that was click and the corresponding message data.
**(8)**`replyMessage` object is available when the user replied to another message by clicking the corresponding icon, and contains the message information that was clicked.
564
+
**(9)**`replyMessage` object is available when the user replied to another message by clicking the corresponding icon, and contains the message information that was clicked.
537
565
538
566
<br>
539
567
@@ -550,7 +578,8 @@ Example:
550
578
| <divstyle="width:230px">Slot</div> | Action | Data | Overridden slots |
0 commit comments