botframework-webchat-component
Version:
React component of botframework-webchat
30 lines (26 loc) • 725 B
text/typescript
import { StrictStyleOptions } from 'botframework-webchat-api';
export default function createInitialsAvatarStyle({
accent,
avatarSize,
botAvatarBackgroundColor,
primaryFont,
userAvatarBackgroundColor
}: StrictStyleOptions) {
return {
'&.webchat__initialsAvatar': {
alignItems: 'center',
color: 'White',
fontFamily: primaryFont,
height: avatarSize,
justifyContent: 'center',
overflow: 'hidden',
width: avatarSize,
'&.webchat__initialsAvatar--fromUser': {
backgroundColor: userAvatarBackgroundColor || accent
},
'&:not(.webchat__initialsAvatar--fromUser)': {
backgroundColor: botAvatarBackgroundColor || accent
}
}
};
}