diff --git a/packages/roomkit-react/src/Avatar/Avatar.tsx b/packages/roomkit-react/src/Avatar/Avatar.tsx index 90ae31d39f..c9dd366d9e 100644 --- a/packages/roomkit-react/src/Avatar/Avatar.tsx +++ b/packages/roomkit-react/src/Avatar/Avatar.tsx @@ -47,14 +47,14 @@ type Props = VariantProps & }; export const Avatar: React.FC = ({ name, css, ...props }) => { - const { initials } = getAvatarBg(name); - let { color } = getAvatarBg(name); + const info = getAvatarBg(name); + let { color } = info; if (!name) { color = '#7E47EB'; } return ( - {initials || } + {info.initials || } ); }; diff --git a/packages/roomkit-react/src/Avatar/getAvatarBg.ts b/packages/roomkit-react/src/Avatar/getAvatarBg.ts index 7b7357da04..0ecc311111 100644 --- a/packages/roomkit-react/src/Avatar/getAvatarBg.ts +++ b/packages/roomkit-react/src/Avatar/getAvatarBg.ts @@ -2,13 +2,17 @@ const getInitials = (name: string | undefined) => { if (!name) { return undefined; } else { - return name - .trim() - .match(/(^\S\S?|\b\S)?/g) - ?.join('') - ?.match(/(^\S|\S$)?/g) - ?.join('') - .toUpperCase(); + return ( + name + .trim() + // remove non chars/digits + .replace(/[^a-zA-Z0-9]/g, '') + .match(/(^\S\S?|\b\S)?/g) + ?.join('') + ?.match(/(^\S|\S$)?/g) + ?.join('') + .toUpperCase() + ); } }; diff --git a/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx b/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx index 0747fcb219..cbe59e447e 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Footer/ParticipantList.tsx @@ -2,6 +2,7 @@ import React, { Fragment, useCallback, useState } from 'react'; import { useDebounce, useMedia } from 'react-use'; import { HMSPeer, + HMSPeerType, HMSRoleName, selectHandRaisedPeers, selectHasPeerHandRaised, @@ -14,6 +15,7 @@ import { } from '@100mslive/react-sdk'; import { AddIcon, + CallIcon, ChangeRoleIcon, CrossIcon, HandIcon, @@ -184,6 +186,7 @@ export const Participant = ({ {isConnected && peer.roleName ? ( { const isHandRaised = useHMSStore(selectHasPeerHandRaised(peerId)); const canChangeRole = useHMSStore(selectPermissions)?.changeRole; @@ -290,7 +295,16 @@ const ParticipantActions = React.memo( ) : ( <> - + {peerType === HMSPeerType.REGULAR && } + {peerType === HMSPeerType.SIP && ( + + + + )} {isHandRaised && (