From 599dda457db2d3464d3f203c6d87c6118d89d71b Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Sat, 30 Nov 2024 19:44:06 +0900 Subject: [PATCH 01/10] =?UTF-8?q?refactor:=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20Init=20page=20position=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 이미 init page 함수에서 처리 #240 --- client/src/features/workSpace/WorkSpace.tsx | 4 ++-- .../src/features/workSpace/hooks/usePagesManage.ts | 13 ------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/client/src/features/workSpace/WorkSpace.tsx b/client/src/features/workSpace/WorkSpace.tsx index 69168de2..2d1ea79d 100644 --- a/client/src/features/workSpace/WorkSpace.tsx +++ b/client/src/features/workSpace/WorkSpace.tsx @@ -24,7 +24,7 @@ export const WorkSpace = () => { closePage, updatePage, initPages, - initPagePosition, + // initPagePosition, openPage, } = usePagesManage(workspace, clientId); const visiblePages = pages.filter((page) => page.isVisible && page.isLoaded); @@ -36,7 +36,7 @@ export const WorkSpace = () => { setWorkspace(newWorkspace); initPages(newWorkspace.pageList); - initPagePosition(); + // initPagePosition(); } }, [workspaceMetadata]); diff --git a/client/src/features/workSpace/hooks/usePagesManage.ts b/client/src/features/workSpace/hooks/usePagesManage.ts index 9aeec259..07e1f289 100644 --- a/client/src/features/workSpace/hooks/usePagesManage.ts +++ b/client/src/features/workSpace/hooks/usePagesManage.ts @@ -212,17 +212,6 @@ export const usePagesManage = (workspace: WorkSpace | null, clientId: number | n } }; - // 서버에서 처음 불러올때는 좌표를 모르기에, 초기화 과정 필요 - const initPagePosition = () => { - setPages((prevPages) => - prevPages.map((page, index) => ({ - ...page, - x: PAGE_OFFSET * index, - y: PAGE_OFFSET * index, - })), - ); - }; - const initPages = (list: CRDTPage[]) => { const pageList: Page[] = list.map( (crdtPage, index) => @@ -244,7 +233,6 @@ export const usePagesManage = (workspace: WorkSpace | null, clientId: number | n useEffect(() => { initPages([]); - initPagePosition(); }, []); return { @@ -256,6 +244,5 @@ export const usePagesManage = (workspace: WorkSpace | null, clientId: number | n updatePageData, updatePage, initPages, - initPagePosition, }; }; From 06b3eb3fa03e55cedbae2c5c784b79c168f5b9e6 Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Sat, 30 Nov 2024 19:44:48 +0900 Subject: [PATCH 02/10] =?UTF-8?q?refactor:=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20=EB=B2=97=EC=96=B4=EB=82=98=EA=B0=88=EC=8B=9C=20=ED=9D=B0?= =?UTF-8?q?=EC=83=89=20=EB=B0=95=EC=8A=A4=20=EB=9C=A8=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #240 --- client/src/components/button/IconButton.style.ts | 2 +- client/src/components/button/textButton.style.ts | 2 +- client/src/components/sidebar/Sidebar.style.ts | 1 + client/src/styles/global.ts | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/components/button/IconButton.style.ts b/client/src/components/button/IconButton.style.ts index 12d4a222..940070de 100644 --- a/client/src/components/button/IconButton.style.ts +++ b/client/src/components/button/IconButton.style.ts @@ -3,7 +3,7 @@ import { cva } from "@styled-system/css"; export const iconButtonContainer = cva({ base: { display: "flex", - + flexShrink: 1, justifyContent: "center", alignItems: "center", borderRadius: "xs", diff --git a/client/src/components/button/textButton.style.ts b/client/src/components/button/textButton.style.ts index 3098d474..f31cd317 100644 --- a/client/src/components/button/textButton.style.ts +++ b/client/src/components/button/textButton.style.ts @@ -9,7 +9,7 @@ const textButton = cva({ base: { borderRadius: "md", width: "50%", - height: "40px", + paddingY: "4px", cursor: "pointer", }, variants: { diff --git a/client/src/components/sidebar/Sidebar.style.ts b/client/src/components/sidebar/Sidebar.style.ts index 3dfbe9dc..c7f05736 100644 --- a/client/src/components/sidebar/Sidebar.style.ts +++ b/client/src/components/sidebar/Sidebar.style.ts @@ -25,6 +25,7 @@ export const plusIconBox = css({ position: "absolute", bottom: "0px", gap: "md", + flexShrink: 1, justifyContent: "space-between", alignItems: "center", width: "100%", diff --git a/client/src/styles/global.ts b/client/src/styles/global.ts index 75c7ee1d..2c9f0784 100644 --- a/client/src/styles/global.ts +++ b/client/src/styles/global.ts @@ -12,6 +12,7 @@ export const globalStyles = defineGlobalStyles({ backgroundImage: 'url("./assets/images/background.png")', backgroundSize: "cover", fontFamily: "Pretendard, sans-serif", + boxSizing: "border-box", }, // 스크롤바 전체 "::-webkit-scrollbar": { From 3a8a936d4a646698b9635e603f021699539be489 Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Sat, 30 Nov 2024 19:49:13 +0900 Subject: [PATCH 03/10] =?UTF-8?q?refactor:=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20=EB=B2=97=EC=96=B4=EB=82=98=EA=B0=88=EC=8B=9C=20=EC=98=A4?= =?UTF-8?q?=EB=B2=84=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=95=88=EB=B3=B4?= =?UTF-8?q?=EC=9D=B4=EA=B2=8C=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #240 --- client/src/features/workSpace/WorkSpace.style.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/src/features/workSpace/WorkSpace.style.ts b/client/src/features/workSpace/WorkSpace.style.ts index 85cafdf1..be7e97b7 100644 --- a/client/src/features/workSpace/WorkSpace.style.ts +++ b/client/src/features/workSpace/WorkSpace.style.ts @@ -8,6 +8,9 @@ export const content = css({ export const workSpaceContainer = cva({ base: { display: "flex", + width: "100vw", + height: "100vh", + overflow: "hidden", transition: "opacity 0.3s ease-in-out", }, variants: { From 1dec80b9a07c1f50855e8621e68c2478ae874cf3 Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Sat, 30 Nov 2024 19:50:58 +0900 Subject: [PATCH 04/10] =?UTF-8?q?refactor:=20auth=20button=20ui=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EB=B0=98?= =?UTF-8?q?=EC=9D=91=ED=98=95=20=EC=B2=98=EB=A6=AC=20#240?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/features/auth/AuthButton.style.ts | 10 ++++++++++ client/src/features/auth/AuthButton.tsx | 10 ++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 client/src/features/auth/AuthButton.style.ts diff --git a/client/src/features/auth/AuthButton.style.ts b/client/src/features/auth/AuthButton.style.ts new file mode 100644 index 00000000..00e65f86 --- /dev/null +++ b/client/src/features/auth/AuthButton.style.ts @@ -0,0 +1,10 @@ +import { css } from "@styled-system/css"; + +export const container = css({ + display: "flex", + gap: "md", + flexGrow: 1, + justifyContent: "end", + alignItems: "center", + width: "auto", +}); diff --git a/client/src/features/auth/AuthButton.tsx b/client/src/features/auth/AuthButton.tsx index 82dbffea..72c57daa 100644 --- a/client/src/features/auth/AuthButton.tsx +++ b/client/src/features/auth/AuthButton.tsx @@ -4,6 +4,8 @@ import { TextButton } from "@components/button/textButton"; import { Modal } from "@components/modal/modal"; import { useModal } from "@components/modal/useModal"; import { AuthModal } from "./AuthModal"; +import { css } from "@styled-system/css"; +import { container } from "./AuthButton.style"; export const AuthButton = () => { const isLogin = useCheckLogin(); @@ -23,13 +25,13 @@ export const AuthButton = () => { const { mutate: logout } = useLogoutMutation(closeLogoutModal); return ( - <> +
{isLogin ? ( - + 로그아웃 ) : ( - + 로그인 )} @@ -44,6 +46,6 @@ export const AuthButton = () => { >

로그아웃 하시겠습니까?

- +
); }; From 8a6ee495b80ff41aa247ec4fd988b6ead1916e8e Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Sat, 30 Nov 2024 19:51:32 +0900 Subject: [PATCH 05/10] =?UTF-8?q?feat:=20=EC=B5=9C=EB=8C=80=ED=99=94?= =?UTF-8?q?=EC=83=81=ED=83=9C=EC=97=90=EC=84=9C=EB=8A=94=20=EC=B5=9C?= =?UTF-8?q?=EB=8C=80=ED=99=94=20=EB=B2=84=ED=8A=BC=EB=A7=8C=20=EB=8B=A4?= =?UTF-8?q?=EC=8B=9C=20=EB=88=84=EB=A5=BC=EC=88=98=20=EC=9E=88=EA=B2=8C=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #240 --- client/src/features/page/Page.tsx | 5 ++++- .../PageControlButton/PageControlButton.style.ts | 5 +++++ .../components/PageControlButton/PageControlButton.tsx | 8 +++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/client/src/features/page/Page.tsx b/client/src/features/page/Page.tsx index fdab49e4..474f67f7 100644 --- a/client/src/features/page/Page.tsx +++ b/client/src/features/page/Page.tsx @@ -32,7 +32,9 @@ export const Page = ({ handleTitleChange, serializedEditorData, }: PageProps) => { - const { position, size, pageDrag, pageResize, pageMinimize, pageMaximize } = usePage({ x, y }); + const { position, size, isMaximized, pageDrag, pageResize, pageMinimize, pageMaximize } = usePage( + { x, y }, + ); const [serializedEditorDatas, setSerializedEditorDatas] = useState(serializedEditorData); @@ -74,6 +76,7 @@ export const Page = ({
handlePageClose(id)} onPageMaximize={pageMaximize} onPageMinimize={pageMinimize} diff --git a/client/src/features/page/components/PageControlButton/PageControlButton.style.ts b/client/src/features/page/components/PageControlButton/PageControlButton.style.ts index e064c6f8..42b79b3a 100644 --- a/client/src/features/page/components/PageControlButton/PageControlButton.style.ts +++ b/client/src/features/page/components/PageControlButton/PageControlButton.style.ts @@ -20,6 +20,11 @@ export const pageControlButton = cva({ width: "20px", height: "20px", cursor: "pointer", + "&:disabled": { + background: "gray.400", + opacity: 0.5, + cursor: "not-allowed", + }, }, variants: { color: { diff --git a/client/src/features/page/components/PageControlButton/PageControlButton.tsx b/client/src/features/page/components/PageControlButton/PageControlButton.tsx index 1224e29b..50e14dd4 100644 --- a/client/src/features/page/components/PageControlButton/PageControlButton.tsx +++ b/client/src/features/page/components/PageControlButton/PageControlButton.tsx @@ -4,19 +4,25 @@ import MinusIcon from "@assets/icons/minus.svg?react"; import { pageControlContainer, pageControlButton, iconBox } from "./PageControlButton.style"; interface PageControlButtonProps { + isMaximized: boolean; onPageMinimize?: () => void; onPageMaximize?: () => void; onPageClose?: () => void; } export const PageControlButton = ({ + isMaximized, onPageMinimize, onPageMaximize, onPageClose, }: PageControlButtonProps) => { return (
-