Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat: dynamic avatar font size

Bettenbuk Zoltana35b36d6df63
diff --git a/css/_avatar.scss b/css/_avatar.scss
index b1cd713453..cb47d7d89d 100644
--- a/css/_avatar.scss
+++ b/css/_avatar.scss
@@ -9,6 +9,23 @@
object-fit: cover;
}
+.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%;
+}
+
.defaultAvatar {
opacity: 0.6
}
\ No newline at end of file
diff --git a/react/features/base/avatar/components/web/StatelessAvatar.js b/react/features/base/avatar/components/web/StatelessAvatar.js
index 63f06d4b42..3ef7a77974 100644
--- a/react/features/base/avatar/components/web/StatelessAvatar.js
+++ b/react/features/base/avatar/components/web/StatelessAvatar.js
@@ -52,7 +52,20 @@ export default class StatelessAvatar extends AbstractStatelessAvatar<Props> {
className = { this._getAvatarClassName() }
id = { this.props.id }
style = { this._getAvatarStyle(this.props.color) }>
- { initials }
+ <svg
+ className = 'avatar-svg'
+ 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>
+ </svg>
</div>
);
}