Open source video conferencing app powered by LiveKit. Built with Django and React.
✨(frontend) display host status to meeting participants
lebaudantoine4793f2fa8fc8
diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantListItem.tsx b/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantListItem.tsxindex 63232694..ba8344b7 100644--- a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantListItem.tsx+++ b/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantListItem.tsx@@ -1,10 +1,11 @@import { css } from '@/styled-system/css'-import { HStack } from '@/styled-system/jsx'+import { HStack, VStack } from '@/styled-system/jsx'import { Text } from '@/primitives/Text'import { useTranslation } from 'react-i18next'import { Avatar } from '@/components/Avatar'import { getParticipantColor } from '@/features/rooms/utils/getParticipantColor'+import { getParticipantIsRoomAdmin } from '@/features/rooms/utils/getParticipantIsRoomAdmin'import { Participant, Track } from 'livekit-client'import { isLocal } from '@/utils/livekit'import {@@ -102,36 +103,41 @@ export const ParticipantListItem = ({><HStack><Avatar name={name} bgColor={getParticipantColor(participant)} />- <Text- variant={'sm'}- className={css({- userSelect: 'none',- cursor: 'default',- display: 'flex',- })}- >- <span+ <VStack gap={0} alignItems="start">+ <Text+ smclassName={css({- whiteSpace: 'nowrap',- overflow: 'hidden',- textOverflow: 'ellipsis',- maxWidth: '120px',- display: 'block',+ userSelect: 'none',+ cursor: 'default',+ display: 'flex',})}>- {name}- </span>- {isLocal(participant) && (<spanclassName={css({- marginLeft: '.25rem',whiteSpace: 'nowrap',+ overflow: 'hidden',+ textOverflow: 'ellipsis',+ maxWidth: '120px',+ display: 'block',})}>- ({t('participants.you')})+ {name}</span>+ {isLocal(participant) && (+ <span+ className={css({+ marginLeft: '.25rem',+ whiteSpace: 'nowrap',+ })}+ >+ ({t('participants.you')})+ </span>+ )}+ </Text>+ {getParticipantIsRoomAdmin(participant) && (+ <Text variant="xsNote">{t('participants.host')}</Text>)}- </Text>+ </VStack></HStack><HStack><MicIndicator participant={participant} />diff --git a/src/frontend/src/features/rooms/utils/getParticipantIsRoomAdmin.ts b/src/frontend/src/features/rooms/utils/getParticipantIsRoomAdmin.tsnew file mode 100644index 00000000..a0ee52b5--- /dev/null+++ b/src/frontend/src/features/rooms/utils/getParticipantIsRoomAdmin.ts@@ -0,0 +1,12 @@+import { Participant } from 'livekit-client'++export const getParticipantIsRoomAdmin = (+ participant: Participant+): boolean => {+ const attributes = participant.attributes++ if (!attributes) {+ return false+ }+ return attributes?.room_admin === 'true'+}diff --git a/src/frontend/src/locales/de/rooms.json b/src/frontend/src/locales/de/rooms.jsonindex a6bed7ef..1a8db979 100644--- a/src/frontend/src/locales/de/rooms.json+++ b/src/frontend/src/locales/de/rooms.json@@ -426,6 +426,7 @@"participants": {"subheading": "Im Raum","you": "Du",+ "host": "Host","contributors": "Mitwirkende","collapsable": {"open": "{{name}}-Liste öffnen",diff --git a/src/frontend/src/locales/en/rooms.json b/src/frontend/src/locales/en/rooms.jsonindex 652ec1d2..fd401d7c 100644--- a/src/frontend/src/locales/en/rooms.json+++ b/src/frontend/src/locales/en/rooms.json@@ -426,6 +426,7 @@"participants": {"subheading": "In room","you": "You",+ "host": "Host","contributors": "Contributors","collapsable": {"open": "Open {{name}} list",diff --git a/src/frontend/src/locales/fr/rooms.json b/src/frontend/src/locales/fr/rooms.jsonindex 72e75d85..ebc1bd48 100644--- a/src/frontend/src/locales/fr/rooms.json+++ b/src/frontend/src/locales/fr/rooms.json@@ -427,6 +427,7 @@"subheading": "Dans la réunion","you": "Vous","contributors": "Contributeurs",+ "host": "Organisateur de la réunion","collapsable": {"open": "Ouvrir la liste {{name}}","close": "Fermer la liste {{name}}"diff --git a/src/frontend/src/locales/nl/rooms.json b/src/frontend/src/locales/nl/rooms.jsonindex 42877d2b..b44d56a1 100644--- a/src/frontend/src/locales/nl/rooms.json+++ b/src/frontend/src/locales/nl/rooms.json@@ -426,6 +426,7 @@"participants": {"subheading": "In de ruimte","you": "U",+ "host": "Host","contributors": "Deelnemers","collapsable": {"open": "Open {{name}} lijst",