question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The brand needs the Avatar of the Bot to be a square instead of a circle

See original GitHub issue

Describe the suggestion or request in detail

The brand needs the Avatar of the Bot to be a square instead of a circle

Describe alternatives you have considered

Currently we are changing this style with jQuery command:

jQuery('#webchat').find('div').filter('.avatar').not('.from-user').css('border-radius', '0%')

But sometimes webchat is not rendering as we like and happens this:

image

and of course it is not efficient to do so

Additional context

I would like to use new styleOptions like: botAvatarShapeAsCircle (boolean) userAvatarShapeAsCircle (boolean)

const styleOptions = {
	...
	botAvatarImage: baseUrl.concat('/img/avatar_bot_squ.png'),
	botAvatarInitials: 'BOT',
	botAvatarBackgroundColor: 'white',
	botAvatarShapeAsCircle: false,
	userAvatarImage: webchatItem.userAvatar,
	userAvatarInitials: 'USER',
	userAvatarBackgroundColor: 'white',
	userAvatarShapeAsCircle: true,
	...
}

With an implementation similar to this on createAvatarStyle… :

export default function createAvatarStyle({
  accent,
  avatarSize,
  botAvatarBackgroundColor,
  botShapeAsCircle,
  primaryFont,
  userAvatarBackgroundColor
}) {
  var borderRadiusValue = '50%'
  if !botShapeAsCircle borderRadiusValue = 'inherit'
  
  return {
    alignItems: 'center',
    borderRadius: borderRadiusValue,
	...

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tdurnfordcommented, Feb 5, 2020

@eduardmartos You can currently modify the style set to change the avatars border radius. Take a look at the code snippet below.

Screenshot

image

Web Chat v4.7.1

const styleOptions = {
  botAvatarImage:
    'https://docs.microsoft.com/en-us/azure/bot-service/v4sdk/media/logo_bot.svg?view=azure-bot-service-4.0',
  botAvatarInitials: 'BF',
  userAvatarImage: 'https://github.com/compulim.png?size=64',
  userAvatarInitials: 'WC'
};

const styleSet = window.WebChat.createStyleSet(styleOptions);

styleSet.avatar = {
  ...styleSet.avatar,
  borderRadius: 0
};

window.WebChat.renderWebChat(
  {
    directLine: window.WebChat.createDirectLine({ token }),
    styleSet
  },
  document.getElementById('webchat')
);

Additional Context

https://github.com/microsoft/BotFramework-WebChat/issues/1977

@corinagum @compulim Should we consider adding userAvatarBorderRadius and botAvatarBorderRadius to the default style options?

1reaction
corinagumcommented, Feb 5, 2020

@tdurnford my vote is yes 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Twitter Switches Brand Profile Avatars to Squares to Counter ...
As you can see in this image, posted by social media expert Matt Navarra, brand profiles are now showing up as square tiles,...
Read more >
How can I set an image or thumbnail as the bot's avatar in ...
so if I wanted to set thumbnail or image as bot's avatar, what would would I do? I tried: embed.set_author(name=bot.name, icon_url=bot.avatar.
Read more >
Why does squaring of the radius of a circle times pi give us the ...
Essentially, you need to square some linear measure of the circle to get to an area. The radius and the circumference are in...
Read more >
How the Logo Shape Affects Customers - ZenBusiness
The circle is so versatile that it is used as a symbol of various companies including non-profit organizations, retailers, restaurants, finance ...
Read more >
Changing the Design of Your Widget and Bot - Drift Help
In this doc we'll cover. Changing Your Widget Design; Color Guide; Changing Your Bot Avatar. Drift Insider Note: Did you know we have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found