From 028a3834be13d2f5808ade8d1a7ca5ed3947f7f7 Mon Sep 17 00:00:00 2001 From: sayyyho <323psh@naver.com> Date: Tue, 10 Sep 2024 14:58:27 +0900 Subject: [PATCH] =?UTF-8?q?Design:=20=EC=8B=A4=EC=8B=9C=EA=B0=84=20?= =?UTF-8?q?=EC=BB=A4=EB=84=A5=ED=8C=85=20=ED=8E=98=EC=9D=B4=EC=A7=80=20UI?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Common/miniLayout.jsx | 26 ++++++++-- src/components/Common/miniLayout.styled.js | 15 ++++++ src/pages/LoginPage.jsx | 6 +++ src/pages/WebRTC/VideoPage.jsx | 58 ++++++++++++++-------- src/pages/WebRTC/style.jsx | 37 +++++++++++--- 5 files changed, 110 insertions(+), 32 deletions(-) diff --git a/src/components/Common/miniLayout.jsx b/src/components/Common/miniLayout.jsx index 21c5c17..87b8e58 100644 --- a/src/components/Common/miniLayout.jsx +++ b/src/components/Common/miniLayout.jsx @@ -1,12 +1,32 @@ /** @jsxImportSource @emotion/react */ import React from "react"; import Text from "../Common/Text"; -import { LayoutContainer, Line, CenterContent } from "./miniLayout.styled"; +import { + LayoutContainer, + Line, + CenterContent, + ExitButton, + HeaderBox, +} from "./miniLayout.styled"; +import { useNavigate } from "react-router-dom"; -const MiniLayout = ({ text, children, layerWidth }) => { +const MiniLayout = ({ text, children, layerWidth, isButton }) => { + const navigate = useNavigate(); return ( - + + + {isButton && ( + { + window.location.href = "/"; + }} + > + 나가기 + + )} + + {children} diff --git a/src/components/Common/miniLayout.styled.js b/src/components/Common/miniLayout.styled.js index 6944b3b..62d15df 100644 --- a/src/components/Common/miniLayout.styled.js +++ b/src/components/Common/miniLayout.styled.js @@ -5,6 +5,12 @@ export const LayoutContainer = styled.div` width: ${({ width }) => width || "100%"}; box-sizing: border-box; `; +export const HeaderBox = styled.div` + width: 100%; + display: flex; + justify-content: space-around; + align-items: center; +`; export const Line = styled.div` width: 100%; @@ -21,3 +27,12 @@ export const CenterContent = styled.div` gap: 20px; margin: 10px; `; + +export const ExitButton = styled.button` + width: 100px; + height: 50px; + border-radius: 20px; + border: 1px solid #ebc500; + background-color: #ffef61; + cursor: pointer; +`; diff --git a/src/pages/LoginPage.jsx b/src/pages/LoginPage.jsx index 27cee6f..664d823 100644 --- a/src/pages/LoginPage.jsx +++ b/src/pages/LoginPage.jsx @@ -15,6 +15,12 @@ function LoginPage() { return (

Login Page

+
+ +
diff --git a/src/pages/WebRTC/VideoPage.jsx b/src/pages/WebRTC/VideoPage.jsx index 586effb..2710ae9 100644 --- a/src/pages/WebRTC/VideoPage.jsx +++ b/src/pages/WebRTC/VideoPage.jsx @@ -2,6 +2,7 @@ import React, { useEffect, useRef } from "react"; import Layout from "../../components/Common/Layout"; import * as S from "./style"; import { io } from "socket.io-client"; +import MiniLayout from "../../components/Common/miniLayout"; const RTCPage = () => { const socketRef = useRef(null); @@ -114,27 +115,42 @@ const RTCPage = () => { return ( -

실시간 화상 채팅

- - - + + + + + + + +
); }; diff --git a/src/pages/WebRTC/style.jsx b/src/pages/WebRTC/style.jsx index 8564bf6..d315149 100644 --- a/src/pages/WebRTC/style.jsx +++ b/src/pages/WebRTC/style.jsx @@ -1,19 +1,40 @@ /** @jsxImportSource @emotion/react */ import { css } from "@emotion/react"; -export const StyledDiv = ({ children }) => { - const defaultYellow = "#FFF496"; - const defaultBrown = "#715F00"; - const liteBrwon = "#D3CBA1"; - const black = "#000"; +const defaultYellow = "#FFF496"; +const defaultBrown = "#715F00"; +const liteBrwon = "#D3CBA1"; +const black = "#000"; + +export const VideoLayout = ({ children }) => { + return ( +
+ {children} +
+ ); +}; + +export const VideoBox = ({ children }) => { return (
{children}