From f88e4a80c0e9f62eb545728cfd77efa6783487bf Mon Sep 17 00:00:00 2001 From: inmake Date: Fri, 31 Oct 2025 15:17:52 +0500 Subject: [PATCH] Update environment variables for local development, adjust DraggableContainer and SessionUsersPanel to switch between 'mini' and 'full' modes, and refactor UserCamera and UserDevicesControls for improved styling and responsiveness. Clean up SessionPage layout for better structure. --- client/.env | 8 +++---- client/src/components/DraggableContainer.tsx | 2 +- client/src/components/SessionUsersPanel.tsx | 23 +++++++++---------- client/src/components/ui/UserCamera.tsx | 4 ++-- .../src/components/ui/UserDevicesControls.tsx | 2 +- client/src/pages/SessionPage.tsx | 8 +++---- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/client/.env b/client/.env index 5e374be..0f22f67 100644 --- a/client/.env +++ b/client/.env @@ -1,4 +1,4 @@ -# VITE_API_URL=http://localhost:3000 -# VITE_WEBRTC_URL=http://localhost:3001 -VITE_API_URL=https://stream.graff.estate/api -VITE_WEBRTC_URL=https://stream.graff.estate \ No newline at end of file +VITE_API_URL=http://localhost:3000 +VITE_WEBRTC_URL=http://localhost:3001 +# VITE_API_URL=https://stream.graff.estate/api +# VITE_WEBRTC_URL=https://stream.graff.estate \ No newline at end of file diff --git a/client/src/components/DraggableContainer.tsx b/client/src/components/DraggableContainer.tsx index 6f93a6d..4ebaf42 100644 --- a/client/src/components/DraggableContainer.tsx +++ b/client/src/components/DraggableContainer.tsx @@ -505,7 +505,7 @@ export default function DraggableContainer({ className={clsx( "pointer-events-auto", // draggable && "touch-none", - !isDragging && enableSnapping && "transition-all duration-500 ease-out", + !isDragging && enableSnapping && "transition-[inset] duration-500 ease-out", draggable && !dragHandleRef && (isDragging ? "cursor-grabbing" : "cursor-grab"), diff --git a/client/src/components/SessionUsersPanel.tsx b/client/src/components/SessionUsersPanel.tsx index fb556b2..ad8fae2 100644 --- a/client/src/components/SessionUsersPanel.tsx +++ b/client/src/components/SessionUsersPanel.tsx @@ -150,18 +150,18 @@ function SessionUsersPanel({ return ( = 640 ? "bottom-right" : "top-right" } padding="1.111vw" className={clsx( - "z-[999] 2xl:gap-[0.556vw] gap-2", - mode === "full" + "z-[100] 2xl:gap-[0.556vw] gap-2", + mode === "mini" ? "flex" - : `2xl:p-[5vw] p-4 w-full 2xl:h-dvh max-2xl:portrait:max-h-[calc(100dvh-17.778vw)] max-2xl:landscape:max-h-[calc(100dvh-8.75vw)] grid grid-cols-${gridColumns}` + : `2xl:p-[5vw] p-4 w-full 2xl:h-dvh max-2xl:portrait:max-h-[calc(100dvh-17.778vw)] max-2xl:landscape:max-h-[calc(100dvh-8.75vw)] grid grid-cols-${gridColumns} relative bg-black` )} > {localStream && @@ -181,12 +181,11 @@ function SessionUsersPanel({ onCanControl={() => console.log("Toggle control")} onSpeakingChange={handleSpeakingChange} className={clsx( - mode === "mini" && - (activeCamerasCount <= 2 - ? "m-auto" - : activeCamerasCount > 12 - ? "!aspect-square w-full" - : "w-full") + mode === "full" && activeCamerasCount <= 2 + ? "m-auto" + : activeCamerasCount > 12 + ? "!aspect-square w-full" + : "w-full" )} /> ))} @@ -201,7 +200,7 @@ function SessionUsersPanel({ .map((participant) => ( 12 diff --git a/client/src/components/ui/UserCamera.tsx b/client/src/components/ui/UserCamera.tsx index 6ec25e1..799d136 100644 --- a/client/src/components/ui/UserCamera.tsx +++ b/client/src/components/ui/UserCamera.tsx @@ -278,7 +278,7 @@ export default function UserCamera({ return (
= 1536 ? "0.069vw" : "1px" } rgba(255, 255, 255, 0.3)`, transition: - mode === "full" + mode === "mini" ? "box-shadow 0.1s ease-out, width 0.3s, background-color 0.3s" : undefined, }} diff --git a/client/src/components/ui/UserDevicesControls.tsx b/client/src/components/ui/UserDevicesControls.tsx index da5a7c7..e3d0ffd 100644 --- a/client/src/components/ui/UserDevicesControls.tsx +++ b/client/src/components/ui/UserDevicesControls.tsx @@ -35,7 +35,7 @@ export default function UserDevicesControls({ return (