Create icons for users without an avatar in desktop notifications (#305)

* Add notifications icon for users without an avatar

* Render icon at higher resolution

* Use scale to render at higher resolution
This commit is contained in:
ginnyTheCat
2022-02-15 12:48:25 +01:00
committed by GitHub
parent fe674ef2ea
commit 8d3f0a9f4d
5 changed files with 88 additions and 15 deletions

View File

@@ -8,6 +8,7 @@ import Text from '../text/Text';
import RawIcon from '../system-icons/RawIcon';
import ImageBrokenSVG from '../../../../public/res/svg/image-broken.svg';
import { avatarInitials } from '../../../util/common';
function Avatar({
text, bgColor, iconSrc, iconColor, imageSrc, size,
@@ -40,7 +41,7 @@ function Avatar({
? <RawIcon size={size} src={iconSrc} color={iconColor} />
: text !== null && (
<Text variant={textSize} primary>
{twemojify([...text][0])}
{twemojify(avatarInitials(text))}
</Text>
)
}