BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

React web chat component Avatar image not showing

Open weshackett opened this issue 7 years ago • 5 comments

Following through the custom styling and trying to use an image for the Avatar.

Looked at info for raw js version https://github.com/Microsoft/BotFramework-WebChat/pull/1486

But I can't get the same working when using the React component version.

tried:

const wesstyleOptions = { backgroundColor: 'Black', bubbleBackground: '#222', bubbleBorder: 'solid 1px #444', bubbleBorderRadius: 20, bubbleFromUserBackground: '#222', bubbleFromUserBorder: 'solid 1px #444', bubbleFromUserBorderRadius: 20, bubbleFromUserTextColor: 'White', bubbleTextColor: 'White', botAvatarImage: 'https://docs.microsoft.com/en-us/azure/bot-service/v4sdk/media/logo_bot.svg?view=azure-bot-service-4.0', userAvatarImage: 'https://github.com/compulim.png?size=64', };

<ReactWebChat styleOptions={wesstyleOptions} botAvatarInitials={"IB"} botAvatarImage= 'https://docs.microsoft.com/en-us/azure/bot-service/v4sdk/media/logo_bot.svg?view=azure-bot-service-4.0' // userAvatarImage={/_layouts/15/userphoto.aspx?size=S&username=${this.state.user.mail}} userAvatarInitials={this.getUserInitials()} directLine={this._directLine} userID={this.state.user.id} />

weshackett avatar Jan 17 '19 10:01 weshackett

Hi @weshackett, what CDN or NPM version of Web Chat are you using? I'm using latest bits (/master) on mine and I got the avatar images to render: image

corinagum avatar Jan 17 '19 17:01 corinagum

This is what is in my package.json

"botframework-directlinejs": "^0.10.2", "botframework-webchat": "^4.2.0", "react": "16.3.2", "react-dom": "16.3.2"

It's a SharePoint Framework solution project

Installed from npm

weshackett avatar Jan 17 '19 19:01 weshackett

You'll have to use the latest bits as opposed to the latest release, until NEXT release where avatar support will be live. Please use: 4.2.1-master.b341439

corinagum avatar Jan 17 '19 19:01 corinagum

So if i pull the master source and build with

https://github.com/Microsoft/BotFramework-WebChat#build-tasks

That should give me a local copy that should work?

Also rough timeline for this to get into npm?

weshackett avatar Jan 17 '19 20:01 weshackett

4.2.1-master.b341439 is already released on npm botframework-webchat. You just need to update your package in your project. This will be released in production build by our 4.3 milestone, slated for February 14th.

corinagum avatar Jan 17 '19 21:01 corinagum