fix(avatar): use text instead of foreign object.

Reason: On Safari the foreign object is not scaled correctly.
This commit is contained in:
Hristo Terezov 2020-04-20 18:14:11 -05:00
parent 547d1547bb
commit 9bdaea4069
2 changed files with 10 additions and 21 deletions

View File

@ -20,18 +20,6 @@
}
}
.avatar-foreign {
align-items: center;
bottom: 0;
display: flex;
font-size: 40pt;
justify-content: center;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.avatar-svg {
height: 100%;
width: 100%;
@ -63,4 +51,4 @@
@include avatarBadge;
background-color: $presence-idle;
}
}
}

View File

@ -79,14 +79,15 @@ export default class StatelessAvatar extends AbstractStatelessAvatar<Props> {
viewBox = '0 0 100 100'
xmlns = 'http://www.w3.org/2000/svg'
xmlnsXlink = 'http://www.w3.org/1999/xlink'>
<foreignObject
height = '100%'
width = '100%'>
<span
className = 'avatar-foreign'>
{ initials }
</span>
</foreignObject>
<text
dominantBaseline = 'central'
fill = 'rgba(255,255,255,.6)'
fontSize = '40pt'
textAnchor = 'middle'
x = '50'
y = '50'>
{ initials }
</text>
</svg>
</div>
);