Use more consistent names for layout types

This commit is contained in:
Robin
2024-07-18 11:24:18 -04:00
parent 0664f978e3
commit 4955535374
2 changed files with 11 additions and 11 deletions

View File

@@ -344,9 +344,9 @@ export const InCallView: FC<InCallViewProps> = ({
}; };
return { return {
grid: makeGridLayout(inputs), grid: makeGridLayout(inputs),
"spotlight landscape": makeSpotlightLandscapeLayout(inputs), "spotlight-landscape": makeSpotlightLandscapeLayout(inputs),
"spotlight portrait": makeSpotlightPortraitLayout(inputs), "spotlight-portrait": makeSpotlightPortraitLayout(inputs),
"spotlight expanded": makeSpotlightExpandedLayout(inputs), "spotlight-expanded": makeSpotlightExpandedLayout(inputs),
"one-on-one": makeOneOnOneLayout(inputs), "one-on-one": makeOneOnOneLayout(inputs),
}; };
}, [gridBoundsObservable, spotlightAlignment, pipAlignment]); }, [gridBoundsObservable, spotlightAlignment, pipAlignment]);
@@ -392,7 +392,7 @@ export const InCallView: FC<InCallViewProps> = ({
); );
// The grid tiles go *under* the spotlight in the portrait layout, but // The grid tiles go *under* the spotlight in the portrait layout, but
// *over* the spotlight in the expanded layout // *over* the spotlight in the expanded layout
return layout.type === "spotlight expanded" ? ( return layout.type === "spotlight-expanded" ? (
<> <>
{fixedGrid} {fixedGrid}
{scrollingGrid} {scrollingGrid}

View File

@@ -89,19 +89,19 @@ export interface GridLayout {
} }
export interface SpotlightLandscapeLayout { export interface SpotlightLandscapeLayout {
type: "spotlight landscape"; type: "spotlight-landscape";
spotlight: MediaViewModel[]; spotlight: MediaViewModel[];
grid: UserMediaViewModel[]; grid: UserMediaViewModel[];
} }
export interface SpotlightPortraitLayout { export interface SpotlightPortraitLayout {
type: "spotlight portrait"; type: "spotlight-portrait";
spotlight: MediaViewModel[]; spotlight: MediaViewModel[];
grid: UserMediaViewModel[]; grid: UserMediaViewModel[];
} }
export interface SpotlightExpandedLayout { export interface SpotlightExpandedLayout {
type: "spotlight expanded"; type: "spotlight-expanded";
spotlight: MediaViewModel[]; spotlight: MediaViewModel[];
pip?: UserMediaViewModel; pip?: UserMediaViewModel;
} }
@@ -583,7 +583,7 @@ export class CallViewModel extends ViewModel {
const spotlightLandscapeLayout = combineLatest( const spotlightLandscapeLayout = combineLatest(
[this.grid, this.spotlight], [this.grid, this.spotlight],
(grid, spotlight): Layout => ({ (grid, spotlight): Layout => ({
type: "spotlight landscape", type: "spotlight-landscape",
spotlight, spotlight,
grid, grid,
}), }),
@@ -591,7 +591,7 @@ export class CallViewModel extends ViewModel {
const spotlightExpandedLayout = combineLatest( const spotlightExpandedLayout = combineLatest(
[this.spotlight, this.pip], [this.spotlight, this.pip],
(spotlight, pip): Layout => ({ (spotlight, pip): Layout => ({
type: "spotlight expanded", type: "spotlight-expanded",
spotlight, spotlight,
pip: pip ?? undefined, pip: pip ?? undefined,
}), }),
@@ -641,7 +641,7 @@ export class CallViewModel extends ViewModel {
return combineLatest( return combineLatest(
[this.grid, this.spotlight], [this.grid, this.spotlight],
(grid, spotlight): Layout => ({ (grid, spotlight): Layout => ({
type: "spotlight portrait", type: "spotlight-portrait",
spotlight, spotlight,
grid, grid,
}), }),
@@ -675,7 +675,7 @@ export class CallViewModel extends ViewModel {
); );
public showSpeakingIndicators: Observable<boolean> = this.layout.pipe( public showSpeakingIndicators: Observable<boolean> = 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(), distinctUntilChanged(),
shareReplay(1), shareReplay(1),
); );