From 8d05e938be9900e13466f8ebf64c51b56482eee6 Mon Sep 17 00:00:00 2001 From: Lanskikh Date: Tue, 21 Oct 2025 20:59:26 +0500 Subject: [PATCH] Refactor Popup components to utilize DraggableContainer for improved drag-and-drop functionality and responsiveness. Update layout and styling in ParticipantsPopup, QRCodePopup, SharePopup, and ChatPopup to enhance user experience across different screen sizes. --- client/src/components/SessionUsersPanel2.tsx | 3 +- client/src/components/popups/ChatPopup.tsx | 2 +- .../components/popups/ParticipantsPopup.tsx | 74 ++++++++++--------- client/src/components/popups/QRCodePopup.tsx | 53 +++++++------ client/src/components/popups/SharePopup.tsx | 59 ++++++++------- 5 files changed, 106 insertions(+), 85 deletions(-) diff --git a/client/src/components/SessionUsersPanel2.tsx b/client/src/components/SessionUsersPanel2.tsx index 509271a..672a759 100644 --- a/client/src/components/SessionUsersPanel2.tsx +++ b/client/src/components/SessionUsersPanel2.tsx @@ -35,8 +35,7 @@ function SessionUsersPanel2() { = 640 ? "bottom-right" : "top-right"} padding="1.111vw" className="flex gap-4" > diff --git a/client/src/components/popups/ChatPopup.tsx b/client/src/components/popups/ChatPopup.tsx index e9301ae..783f03e 100644 --- a/client/src/components/popups/ChatPopup.tsx +++ b/client/src/components/popups/ChatPopup.tsx @@ -40,7 +40,7 @@ export default function ChatPopup() { initialPosition={{ right: "5vw" }} > -
+
diff --git a/client/src/components/popups/ParticipantsPopup.tsx b/client/src/components/popups/ParticipantsPopup.tsx index d8b8134..e4e3ccf 100644 --- a/client/src/components/popups/ParticipantsPopup.tsx +++ b/client/src/components/popups/ParticipantsPopup.tsx @@ -10,44 +10,52 @@ import ShareFilledIcon from "../icons/ShareFilledIcon"; import HandRaisedOffFilledIcon from "../icons/HandRaisedOffFilledIcon"; import MicrophoneOffFilledIcon from "../icons/MicrophoneOffFilledIcon"; import { Fragment, useRef } from "react"; +import DraggableContainer from "../DraggableContainer"; export default function ParticipantsPopup() { const participants = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; return ( - -
-
    - {participants.map((participant, index) => ( - - - {index !== participants.length - 1 && ( -
    - )} - - ))} -
- -
-
+ = 640} + centerVertical + constrainToBounds + initialPosition={{ right: "5vw" }} + > + +
+
    + {participants.map((participant, index) => ( + + + {index !== participants.length - 1 && ( +
    + )} + + ))} +
+ +
+
+
); } diff --git a/client/src/components/popups/QRCodePopup.tsx b/client/src/components/popups/QRCodePopup.tsx index bb66868..8b9b5ca 100644 --- a/client/src/components/popups/QRCodePopup.tsx +++ b/client/src/components/popups/QRCodePopup.tsx @@ -4,6 +4,7 @@ import ChevronLeftIcon from "../icons/ChevronLeftIcon"; import usePopupStore from "../../store/popupStore"; import SharePopup from "./SharePopup"; import QRCode from "react-qr-code"; +import DraggableContainer from "../DraggableContainer"; interface QRCodePopupProps { link: string; @@ -13,31 +14,37 @@ function QRCodePopup({ link }: QRCodePopupProps) { const { setPopup } = usePopupStore(); return ( - setPopup()} - > -
- -
- - } + = 640} + centerVertical + constrainToBounds + initialPosition={{ right: "5vw" }} > -
- -
-

Подключайтесь к сеансу

-

- Можно даже с мобильным интернетом -

+ setPopup()} + > +
+ +
+ + } + > +
+ +
+

Подключайтесь к сеансу

+

+ Можно даже с мобильным интернетом +

+
-
- + + ); } diff --git a/client/src/components/popups/SharePopup.tsx b/client/src/components/popups/SharePopup.tsx index c45f4d8..97f6ead 100644 --- a/client/src/components/popups/SharePopup.tsx +++ b/client/src/components/popups/SharePopup.tsx @@ -5,6 +5,7 @@ import Button from "../ui/Button"; import LinkShare from "../ui/LinkShare"; import usePopupStore from "../../store/popupStore"; import QRCodePopup from "./QRCodePopup"; +import DraggableContainer from "../DraggableContainer"; function SharePopup({ link }: { link: string }) { const { setPopup } = usePopupStore(); @@ -22,37 +23,43 @@ function SharePopup({ link }: { link: string }) { } return ( - = 640} + centerVertical + constrainToBounds + initialPosition={{ right: "5vw" }} + > + setPopup()} + > +
+ +
+ + } + > +
+

Скопировать ссылку

+ +
- } - > -
-

Скопировать ссылку

- -
- -
+
+ ); }