|
19 | 19 | - Images, files & emojis
|
20 | 20 | - Edit messages
|
21 | 21 | - Reply to other messages
|
| 22 | +- UI elements for seen, new, deleted and typing messages |
| 23 | +- Online / Offline status |
22 | 24 | - Flexible options
|
23 |
| -- UI elements for seen, new and deleted messages |
24 | 25 | - Custom theming - light and dark modes
|
25 | 26 | - Firestore example
|
26 | 27 | - Web Component support
|
@@ -199,7 +200,9 @@ styles="{
|
199 | 200 | },
|
200 | 201 |
|
201 | 202 | header: {
|
202 |
| - background: '#fff' |
| 203 | + background: '#fff', |
| 204 | + colorRoomName: '#0a0a0a', |
| 205 | + colorRoomInfo: '#9ca6af' |
203 | 206 | },
|
204 | 207 |
|
205 | 208 | footer: {
|
@@ -230,6 +233,7 @@ styles="{
|
230 | 233 | background: '#fff',
|
231 | 234 | backgroundMe: '#ccf2cf',
|
232 | 235 | color: '#0a0a0a',
|
| 236 | + colorStarted: '#9ca6af', |
233 | 237 | backgroundDeleted: '#dadfe2',
|
234 | 238 | colorDeleted: '#757e85',
|
235 | 239 | colorUsername: '#9ca6af',
|
@@ -310,17 +314,33 @@ rooms="[
|
310 | 314 | users: [
|
311 | 315 | {
|
312 | 316 | _id: 1234,
|
313 |
| - username: 'John Doe' |
| 317 | + username: 'John Doe', |
| 318 | + status: { |
| 319 | + state: 'online', |
| 320 | + last_changed: 'today, 14:30' |
| 321 | + } |
314 | 322 | },
|
315 | 323 | {
|
316 | 324 | _id: 4321,
|
317 |
| - username: 'John Snow' |
| 325 | + username: 'John Snow', |
| 326 | + status: { |
| 327 | + state: 'offline', |
| 328 | + last_changed: '14 July, 20:00' |
| 329 | + } |
318 | 330 | }
|
319 |
| - ] |
| 331 | + ], |
| 332 | + typingUsers: [ 4321 ] |
320 | 333 | }
|
321 | 334 | ]"
|
322 | 335 | ```
|
323 | 336 |
|
| 337 | +- For each room user, you can add the `status` property, which can hold the `state` and `last_changed` properties: |
| 338 | + |
| 339 | + - `state` can be `'online'` or `'offline'` |
| 340 | + - `last_changed` is the date when `state` was last modified. |
| 341 | + |
| 342 | +- `typingUsers` is an array of all the users who are currently writing a message |
| 343 | + |
324 | 344 | ### Messages prop
|
325 | 345 |
|
326 | 346 | Message objects are rendered differently depending on their type. Currently, only text, emoji and file types are supported.<br>
|
@@ -368,6 +388,7 @@ messages="[
|
368 | 388 | | menuActionHandler (2) | `{ roomId, action }` | A user clicks on the vertical dots icon inside a room |
|
369 | 389 | | messageActionHandler (3) | `{ roomId, action }` | A user clicks on the dropdown icon inside a message |
|
370 | 390 | | sendMessageReaction | `{ roomId, messageId, reaction, remove }` | A user clicks on the emoji icon inside a message |
|
| 391 | +| typingMessage | `{ message, roomId }` | A user is typing a message | |
371 | 392 |
|
372 | 393 | (1) `fetchMessages` should be a method implementing a pagination system. Its purpose is to load older messages of a conversation when the user scroll on top
|
373 | 394 |
|
|
0 commit comments