From f8d928c7ec0592f3a62c61cd1630b5407651ebdb Mon Sep 17 00:00:00 2001 From: Sagnik <70849397+CodeWithBlaze@users.noreply.github.com> Date: Thu, 15 Sep 2022 23:06:06 +0530 Subject: [PATCH] Add the property to show user name and avatar Added the property name that are required to show user avatar and names for received messages. This is not already mentioned in the docs . Merge this in the docs --- docs/advanced-usage.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index 19bf16d..181db8b 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -428,4 +428,8 @@ export default App ## User avatars & names -To show user avatars & names use `showUserAvatars` and `showUserNames` parameters. Can be used separately. By default, the chat will select one of 10 provided colors as an avatar background and name text color. Color is calculated based on the user's `id` hash code, so it is unique in different rooms. To modify provided colors use `userAvatarNameColors` parameter in [theme](themes). If you want to have one color for everyone, just pass this color as a single item in the `userAvatarNameColors` list. +To show user avatars & names use `showUserAvatars` and `showUserNames` parameters. Can be used separately. By default, the chat will select one of 10 provided colors as an avatar background and name text color. Color is calculated based on the user's `id` hash code, so it is unique in different rooms. To modify provided colors use `userAvatarNameColors` parameter in [theme](themes). If you want to have one color for everyone, just pass this color as a single item in the `userAvatarNameColors` list. To add avatar image use imageUrl property in the user object and to add user names use firstName and lastName property to the user object . Example +```ts +// ... +const user = { id: '06c33e8b-e835-4736-80f4-63f44b66666d',firstName:'Sagnik',lastName:'Saha',imageUrl:'https://bestgoodcaptions.com/wp-content/uploads/2019/12/Profile-Picture-Quotes.jpg'} +```