@100mslive/react-native-room-kit
Version:
100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps.
36 lines • 1.04 kB
JavaScript
import * as React from 'react';
import { Text, StyleSheet, View } from 'react-native';
import { getInitials } from '../utils/functions';
import { COLORS } from '../utils/theme';
export const AvatarView = ({
userName,
style,
initialsStyle
}) => {
return /*#__PURE__*/React.createElement(View, {
style: [styles.avatar, userName.length === 0 ? styles.emptyAvatar : null, style]
}, /*#__PURE__*/React.createElement(Text, {
style: [styles.avatarText, initialsStyle]
}, userName.length === 0 ? '👤' : getInitials(userName)));
};
const styles = StyleSheet.create({
avatar: {
width: 88,
aspectRatio: 1,
backgroundColor: COLORS.EXTENDED.PURPLE,
borderRadius: 44,
justifyContent: 'center',
alignItems: 'center'
},
emptyAvatar: {
backgroundColor: '#C3D0E5' // TODO: use it from variable
},
avatarText: {
color: COLORS.SURFACE.ON_SURFACE.HIGH,
fontSize: 34,
fontFamily: 'Inter-SemiBold',
lineHeight: 40,
letterSpacing: 0.25
}
});
//# sourceMappingURL=AvatarView.js.map