From 52d10c4e2419a01d124be607a22e5977930e6aa8 Mon Sep 17 00:00:00 2001 From: harshithpabbati Date: Thu, 30 Dec 2021 15:59:02 +0530 Subject: [PATCH] Display room name in header --- custom/fitness-demo/components/Call/Header.js | 9 ++++++++- custom/fitness-demo/components/Prejoin/Intro.js | 2 +- custom/shared/components/Button/Button.js | 2 +- custom/shared/contexts/CallProvider.js | 5 +++++ custom/shared/icons/lock-md.svg | 4 ++++ 5 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 custom/shared/icons/lock-md.svg diff --git a/custom/fitness-demo/components/Call/Header.js b/custom/fitness-demo/components/Call/Header.js index c5e3c13..640604a 100644 --- a/custom/fitness-demo/components/Call/Header.js +++ b/custom/fitness-demo/components/Call/Header.js @@ -1,9 +1,13 @@ import React, { useMemo } from 'react'; import HeaderCapsule from '@custom/shared/components/HeaderCapsule'; +import { useCallState } from '@custom/shared/contexts/CallProvider'; import { useParticipants } from '@custom/shared/contexts/ParticipantsProvider'; import { useUIState } from '@custom/shared/contexts/UIStateProvider'; +import { slugify } from '@custom/shared/lib/slugify'; +import { ReactComponent as IconLock } from '@custom/shared/icons/lock-md.svg'; export const Header = () => { + const { roomInfo } = useCallState(); const { participantCount } = useParticipants(); const { customCapsule } = useUIState(); @@ -18,7 +22,10 @@ export const Header = () => { height="32" /> - {process.env.PROJECT_TITLE} + + {roomInfo.privacy === 'private' && } + {slugify.revert(roomInfo.name)} + {`${participantCount} ${ participantCount === 1 ? 'participant' : 'participants' diff --git a/custom/fitness-demo/components/Prejoin/Intro.js b/custom/fitness-demo/components/Prejoin/Intro.js index 657e236..889ab71 100644 --- a/custom/fitness-demo/components/Prejoin/Intro.js +++ b/custom/fitness-demo/components/Prejoin/Intro.js @@ -90,7 +90,7 @@ export const Intro = ({ {error && ( - Failed to obtain token

{error}

+ Failed to create class

{error}

)} {tokenError && ( diff --git a/custom/shared/components/Button/Button.js b/custom/shared/components/Button/Button.js index 65114c1..2b5785b 100644 --- a/custom/shared/components/Button/Button.js +++ b/custom/shared/components/Button/Button.js @@ -292,7 +292,7 @@ export const Button = forwardRef( .button.gray { background: ${theme.gray.light}; - color: ${theme.gray.dark}; + color: var(--text-default); border: 0; } .button.gray:hover, diff --git a/custom/shared/contexts/CallProvider.js b/custom/shared/contexts/CallProvider.js index fb01eda..1f372ab 100644 --- a/custom/shared/contexts/CallProvider.js +++ b/custom/shared/contexts/CallProvider.js @@ -32,6 +32,7 @@ export const CallProvider = ({ token = '', subscribeToTracksAutomatically = true, }) => { + const [roomInfo, setRoomInfo] = useState(null); const [enableScreenShare, setEnableScreenShare] = useState(false); const [videoQuality, setVideoQuality] = useState(VIDEO_QUALITY_AUTO); const [showLocalVideo, setShowLocalVideo] = useState(true); @@ -58,6 +59,8 @@ export const CallProvider = ({ const owner = roomConfig.tokenConfig?.is_owner; const config = roomConfig?.config; + setRoomInfo(roomConfig); + const fullUI = !isOob || (isOob && owner); if (!config) return; @@ -131,6 +134,8 @@ export const CallProvider = ({ enableScreenShare, videoQuality, setVideoQuality, + roomInfo, + setRoomInfo, setBandwidth, setRedirectOnLeave, setShowLocalVideo, diff --git a/custom/shared/icons/lock-md.svg b/custom/shared/icons/lock-md.svg new file mode 100644 index 0000000..0588a7c --- /dev/null +++ b/custom/shared/icons/lock-md.svg @@ -0,0 +1,4 @@ + + + +