From 4955535374567995f2039b3f7f9c72e878c6580a Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 18 Jul 2024 11:24:18 -0400 Subject: [PATCH] Use more consistent names for layout types --- src/room/InCallView.tsx | 8 ++++---- src/state/CallViewModel.ts | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index a3e02869..43808b8e 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -344,9 +344,9 @@ export const InCallView: FC = ({ }; return { grid: makeGridLayout(inputs), - "spotlight landscape": makeSpotlightLandscapeLayout(inputs), - "spotlight portrait": makeSpotlightPortraitLayout(inputs), - "spotlight expanded": makeSpotlightExpandedLayout(inputs), + "spotlight-landscape": makeSpotlightLandscapeLayout(inputs), + "spotlight-portrait": makeSpotlightPortraitLayout(inputs), + "spotlight-expanded": makeSpotlightExpandedLayout(inputs), "one-on-one": makeOneOnOneLayout(inputs), }; }, [gridBoundsObservable, spotlightAlignment, pipAlignment]); @@ -392,7 +392,7 @@ export const InCallView: FC = ({ ); // The grid tiles go *under* the spotlight in the portrait layout, but // *over* the spotlight in the expanded layout - return layout.type === "spotlight expanded" ? ( + return layout.type === "spotlight-expanded" ? ( <> {fixedGrid} {scrollingGrid} diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index 4bb1aaa3..54029b0b 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -89,19 +89,19 @@ export interface GridLayout { } export interface SpotlightLandscapeLayout { - type: "spotlight landscape"; + type: "spotlight-landscape"; spotlight: MediaViewModel[]; grid: UserMediaViewModel[]; } export interface SpotlightPortraitLayout { - type: "spotlight portrait"; + type: "spotlight-portrait"; spotlight: MediaViewModel[]; grid: UserMediaViewModel[]; } export interface SpotlightExpandedLayout { - type: "spotlight expanded"; + type: "spotlight-expanded"; spotlight: MediaViewModel[]; pip?: UserMediaViewModel; } @@ -583,7 +583,7 @@ export class CallViewModel extends ViewModel { const spotlightLandscapeLayout = combineLatest( [this.grid, this.spotlight], (grid, spotlight): Layout => ({ - type: "spotlight landscape", + type: "spotlight-landscape", spotlight, grid, }), @@ -591,7 +591,7 @@ export class CallViewModel extends ViewModel { const spotlightExpandedLayout = combineLatest( [this.spotlight, this.pip], (spotlight, pip): Layout => ({ - type: "spotlight expanded", + type: "spotlight-expanded", spotlight, pip: pip ?? undefined, }), @@ -641,7 +641,7 @@ export class CallViewModel extends ViewModel { return combineLatest( [this.grid, this.spotlight], (grid, spotlight): Layout => ({ - type: "spotlight portrait", + type: "spotlight-portrait", spotlight, grid, }), @@ -675,7 +675,7 @@ export class CallViewModel extends ViewModel { ); public showSpeakingIndicators: Observable = this.layout.pipe( - map((l) => l.type !== "one-on-one" && l.type !== "spotlight expanded"), + map((l) => l.type !== "one-on-one" && l.type !== "spotlight-expanded"), distinctUntilChanged(), shareReplay(1), );