From 734d330a102124be634a40c1807e74021c446492 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 16 Nov 2022 10:45:49 +0000 Subject: [PATCH] CamcelCase for enum values --- src/room/InCallView.tsx | 14 +++++++------- src/video-grid/VideoGrid.stories.tsx | 4 ++-- src/video-grid/VideoTile.tsx | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 9935985b..a75da5f4 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -103,9 +103,9 @@ interface Props { } export enum ConnectionState { - ESTABLISHING_CALL = "establishing call", // call hasn't been established yet - WAIT_MEDIA = "wait_media", // call is set up, waiting for ICE to connect - CONNECTED = "connected", // media is flowing + EstablishingCall = "establishing call", // call hasn't been established yet + WaitMedia = "wait_media", // call is set up, waiting for ICE to connect + Connected = "connected", // media is flowing } // Represents something that should get a tile on the layout, @@ -179,14 +179,14 @@ export function InCallView({ for (const participant of participants) { const userCall = groupCall.getCallByUserId(participant.userId); const feed = userMediaFeeds.find((f) => f.userId === participant.userId); - let connectionState = ConnectionState.ESTABLISHING_CALL; + let connectionState = ConnectionState.EstablishingCall; if (feed && feed.isLocal()) { - connectionState = ConnectionState.CONNECTED; + connectionState = ConnectionState.Connected; } else if (userCall) { if (userCall.state === CallState.Connected) { - connectionState = ConnectionState.CONNECTED; + connectionState = ConnectionState.Connected; } else if (userCall.state === CallState.Connecting) { - connectionState = ConnectionState.WAIT_MEDIA; + connectionState = ConnectionState.WaitMedia; } } newConnStates.set(participant.userId, connectionState); diff --git a/src/video-grid/VideoGrid.stories.tsx b/src/video-grid/VideoGrid.stories.tsx index 54f0cdfd..fc3317c4 100644 --- a/src/video-grid/VideoGrid.stories.tsx +++ b/src/video-grid/VideoGrid.stories.tsx @@ -41,7 +41,7 @@ export const ParticipantsTest = () => { member: new RoomMember("!fake:room.id", `@user${i}:fake.dummy`), focused: false, presenter: false, - connectionState: ConnectionState.CONNECTED, + connectionState: ConnectionState.Connected, })), [participantCount] ); @@ -80,7 +80,7 @@ export const ParticipantsTest = () => { key={item.id} name={`User ${item.id}`} disableSpeakingIndicator={items.length < 3} - connectionState={ConnectionState.CONNECTED} + connectionState={ConnectionState.Connected} {...rest} /> )} diff --git a/src/video-grid/VideoTile.tsx b/src/video-grid/VideoTile.tsx index 693475bb..1473ec46 100644 --- a/src/video-grid/VideoTile.tsx +++ b/src/video-grid/VideoTile.tsx @@ -73,7 +73,7 @@ export const VideoTile = forwardRef( const { t } = useTranslation(); const toolbarButtons: JSX.Element[] = []; - if (connectionState == ConnectionState.CONNECTED && !isLocal) { + if (connectionState == ConnectionState.Connected && !isLocal) { toolbarButtons.push( ( let caption: string; switch (connectionState) { - case ConnectionState.ESTABLISHING_CALL: + case ConnectionState.EstablishingCall: caption = t("{{name}} (Connecting...)", { name }); break; - case ConnectionState.WAIT_MEDIA: + case ConnectionState.WaitMedia: // not strictly true, but probably easier to understand than, "Waiting for media" caption = t("{{name}} (Waiting for video...)", { name }); break; - case ConnectionState.CONNECTED: + case ConnectionState.Connected: caption = name; break; }