From d35a7acd175148ef26fae9ff0813efc843962dca Mon Sep 17 00:00:00 2001 From: William Wong Date: Fri, 14 Dec 2018 15:57:20 -0800 Subject: [PATCH] Add avatar image support (#1486) * Add avatar image support and move avatar initials props to styleOptions * Add sample * Update PR number * Remove memoize style * Update verbiage * Using CroppedImage for centering --- CHANGELOG.md | 12 ++++- README.md | 1 + packages/component/src/Activity/Avatar.js | 54 +++++++++++++++---- .../src/Activity/CarouselFilmStrip.js | 21 ++------ .../component/src/Activity/StackedLayout.js | 12 ++--- packages/component/src/Composer.js | 36 ++++++++++--- .../component/src/Styles/StyleSet/Avatar.js | 9 +++- .../src/Styles/defaultStyleSetOptions.js | 27 ++++++---- .../index.html | 50 +++++++++++++++++ .../index.html | 6 ++- 10 files changed, 172 insertions(+), 56 deletions(-) create mode 100644 samples/04.b.display-user-bot-images-styling/index.html diff --git a/CHANGELOG.md b/CHANGELOG.md index d404a6efb2..233f9d5cde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. + + + + +
+ + + diff --git a/samples/04.display-user-bot-initials-styling/index.html b/samples/04.display-user-bot-initials-styling/index.html index a84cb90a6e..93102da1f3 100644 --- a/samples/04.display-user-bot-initials-styling/index.html +++ b/samples/04.display-user-bot-initials-styling/index.html @@ -32,9 +32,11 @@ const { token } = await res.json(); window.WebChat.renderWebChat({ - botAvatarInitials: 'BF', directLine: window.WebChat.createDirectLine({ token }), - userAvatarInitials: 'WC' + styleOptions: { + botAvatarInitials: 'BF', + userAvatarInitials: 'WC' + } }, document.getElementById('webchat')); document.querySelector('#webchat > *').focus();