diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index a0f7917f..d4717c1b 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -51,7 +51,11 @@ import { UserMenuContainer } from "../UserMenuContainer"; import { useRageshakeRequestModal } from "../settings/submit-rageshake"; import { RageshakeRequestModal } from "./RageshakeRequestModal"; import { useMediaHandler } from "../settings/useMediaHandler"; -import { useShowInspector, useSpatialAudio } from "../settings/useSetting"; +import { + useNewGrid, + useShowInspector, + useSpatialAudio, +} from "../settings/useSetting"; import { useModalTriggerState } from "../Modal"; import { useAudioContext } from "../video-grid/useMediaStream"; import { useFullscreen } from "../video-grid/useFullscreen"; @@ -277,6 +281,8 @@ export function InCallView({ [] ); + const [newGrid] = useNewGrid(); + const Grid = newGrid ? NewVideoGrid : VideoGrid; const prefersReducedMotion = usePrefersReducedMotion(); const renderContent = (): JSX.Element => { @@ -306,7 +312,7 @@ export function InCallView({ } return ( - )} - + ); }; diff --git a/src/settings/SettingsModal.tsx b/src/settings/SettingsModal.tsx index 106ef9e0..244d1d15 100644 --- a/src/settings/SettingsModal.tsx +++ b/src/settings/SettingsModal.tsx @@ -33,6 +33,7 @@ import { useShowInspector, useOptInAnalytics, canEnableSpatialAudio, + useNewGrid, } from "./useSetting"; import { FieldRow, InputField } from "../input/Input"; import { Button } from "../button"; @@ -62,6 +63,7 @@ export const SettingsModal = (props: Props) => { const [showInspector, setShowInspector] = useShowInspector(); const [optInAnalytics, setOptInAnalytics] = useOptInAnalytics(); const [keyboardShortcuts, setKeyboardShortcuts] = useKeyboardShortcuts(); + const [newGrid, setNewGrid] = useNewGrid(); const downloadDebugLog = useDownloadDebugLog(); @@ -216,6 +218,17 @@ export const SettingsModal = (props: Props) => { } /> + + ) => + setNewGrid(e.target.checked) + } + /> + {t("Download debug logs")} diff --git a/src/settings/useSetting.ts b/src/settings/useSetting.ts index 75754e5a..6729a301 100644 --- a/src/settings/useSetting.ts +++ b/src/settings/useSetting.ts @@ -90,3 +90,4 @@ export const useShowInspector = () => useSetting("show-inspector", false); export const useOptInAnalytics = () => useSetting("opt-in-analytics", false); export const useKeyboardShortcuts = () => useSetting("keyboard-shortcuts", true); +export const useNewGrid = () => useSetting("new-grid", false); diff --git a/src/video-grid/VideoGrid.module.css b/src/video-grid/VideoGrid.module.css index df6e4fa7..27fff2fc 100644 --- a/src/video-grid/VideoGrid.module.css +++ b/src/video-grid/VideoGrid.module.css @@ -19,4 +19,5 @@ limitations under the License. overflow: hidden; flex: 1; touch-action: none; + margin-bottom: var(--footerHeight); } diff --git a/src/video-grid/VideoGrid.tsx b/src/video-grid/VideoGrid.tsx index 2c6cb5b9..cb94e407 100644 --- a/src/video-grid/VideoGrid.tsx +++ b/src/video-grid/VideoGrid.tsx @@ -899,6 +899,7 @@ export function VideoGrid({ shadow: 0, scale: 0, opacity: 0, + zIndex: 0, }, reset: false, }; @@ -922,6 +923,7 @@ export function VideoGrid({ shadow: number; scale: number; opacity: number; + zIndex?: number; x?: number; y?: number; width?: number; @@ -1178,22 +1180,18 @@ export function VideoGrid({ return ( - {springs.map(({ shadow, ...style }, i) => { + {springs.map((style, i) => { const tile = tiles[i]; const tilePosition = tilePositions[tile.order]; return children({ ...bindTile(tile.key), - key: tile.key, - style: { - boxShadow: shadow.to( - (s) => `rgba(0, 0, 0, 0.5) 0px ${s}px ${2 * s}px 0px` - ), - ...style, - }, - width: tilePosition.width, - height: tilePosition.height, + ...style, + key: tile.item.id, + targetWidth: tilePosition.width, + targetHeight: tilePosition.height, item: tile.item, + onDragRef: onTileDragRef, }); })} diff --git a/src/video-grid/VideoTileContainer.tsx b/src/video-grid/VideoTileContainer.tsx index 5bffc6c6..86140339 100644 --- a/src/video-grid/VideoTileContainer.tsx +++ b/src/video-grid/VideoTileContainer.tsx @@ -52,7 +52,7 @@ interface Props { y: SpringValue; width: SpringValue; height: SpringValue; - onDragRef: RefObject< + onDragRef?: RefObject< ( tileId: string, state: Parameters>[0] @@ -100,7 +100,7 @@ export const VideoTileContainer: FC = memo( isLocal || maximised ); - useDrag((state) => onDragRef.current!(item.id, state), { + useDrag((state) => onDragRef?.current!(item.id, state), { target: tileRef, filterTaps: true, preventScroll: true,