From 47a24afbc3c5ba94c1693b3f5f38fc9f85a9e7d9 Mon Sep 17 00:00:00 2001 From: youngeunkim Date: Wed, 3 Jan 2024 08:20:54 +0900 Subject: [PATCH 1/9] =?UTF-8?q?feat:=20=EC=84=A4=EC=A0=95=20=EB=AA=A8?= =?UTF-8?q?=EB=8B=AC=20=EC=B0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/images/Back.png | Bin 0 -> 230 bytes src/assets/images/index.ts | 1 + .../common/Header/@setting/setting.tsx | 64 ++++++++++++++++++ src/components/common/Header/index.tsx | 16 ++++- 4 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 src/assets/images/Back.png create mode 100644 src/components/common/Header/@setting/setting.tsx diff --git a/src/assets/images/Back.png b/src/assets/images/Back.png new file mode 100644 index 0000000000000000000000000000000000000000..e14e1a65bff69e98153c755c21ad7087a18597d7 GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4foCO|{#S9GG!XV7ZFl&wkP>``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eBezm8IV@L(#(aVWk4GKK04=x^kcGhOs*TWoB zEWgJcb`&}JJ7Bp|{K^lel3y#M>KB_z-l{h__|Zxti`S*Vy!*lJnH+NSPWUn0+Z8(D zWjp7E6|Mi9))k2FeG;%V$JOg|P+#;ZR?nT6P6*xQxh!J5nkDO@6`#V2Y>|hn_sE;8 XyzUBCYB@Cr=nMu=S3j3^P6 void; +} + +const SettingModal = ({ onClose }: SettingModalProps) => { + return ( + + + + 설정 + + + 로그아웃 + + + ); +}; + +const ModalOverlay = styled.div` + position: fixed; + top: 0; + left: 0; + ${flex.CENTER}; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); +`; + +const ModalContent = styled.div` + background-color: ${theme.white}; + padding: 1.5%; + border-radius: 3%; +`; + +const SettingBox = styled.div` + ${flex.VERTICAL} +`; +const SettingText = styled.p` + ${flex.CENTER}; + ${font.H4}; +`; +const ExitButton = styled(Image)` + margin-left: 17rem; +`; +const LogoutBox = styled.div` + ${flex.CENTER}; + margin: 7% 0 0 0; + border-radius: 5%; + color: ${theme.black}; + ${font.H4}; + background-color: #f1f3f5; + padding: 2%; + cursor: pointer; +`; + +export default SettingModal; diff --git a/src/components/common/Header/index.tsx b/src/components/common/Header/index.tsx index 73f1209c..3e84ef16 100644 --- a/src/components/common/Header/index.tsx +++ b/src/components/common/Header/index.tsx @@ -1,15 +1,27 @@ -import React from "react"; +import React, { useState } from "react"; import styled from "styled-components"; import { theme, flex } from "@/styles"; import { Logo, Setting } from "@/assets/icons"; import Navigation from "./Navigation"; +import SettingModal from "./@setting/setting"; const Header = () => { + const [isSettingModalOpen, setSettingModalOpen] = useState(false); + + const openSettingModal = () => { + setSettingModalOpen(true); + }; + + const closeSettingModal = () => { + setSettingModalOpen(false); + }; + return ( - + + {isSettingModalOpen && } ); }; From 422a7e1f94cfe440dd9ec20bf753177569feba22 Mon Sep 17 00:00:00 2001 From: youngeunkim Date: Wed, 3 Jan 2024 09:48:10 +0900 Subject: [PATCH 2/9] =?UTF-8?q?chore:=20=ED=8F=B4=EB=8D=94=20=EA=B5=AC?= =?UTF-8?q?=EC=A1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Header/@setting/layouts/setting.tsx | 64 +++++++++++++++++++ src/components/common/Header/index.tsx | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 src/components/common/Header/@setting/layouts/setting.tsx diff --git a/src/components/common/Header/@setting/layouts/setting.tsx b/src/components/common/Header/@setting/layouts/setting.tsx new file mode 100644 index 00000000..5a264f85 --- /dev/null +++ b/src/components/common/Header/@setting/layouts/setting.tsx @@ -0,0 +1,64 @@ +import React from "react"; +import styled from "styled-components"; +import Image from "next/image"; +import { Back } from "@/assets/images"; +import { theme, flex, font } from "@/styles"; + +interface SettingModalProps { + onClose: () => void; +} + +const SettingModal = ({ onClose }: SettingModalProps) => { + return ( + + + + 설정 + + + 로그아웃 + + + ); +}; + +const ModalOverlay = styled.div` + position: fixed; + top: 0; + left: 0; + ${flex.CENTER}; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); +`; + +const ModalContent = styled.div` + background-color: ${theme.white}; + padding: 1.5%; + border-radius: 3%; +`; + +const SettingBox = styled.div` + ${flex.VERTICAL} +`; +const SettingText = styled.p` + ${flex.CENTER}; + ${font.H4}; +`; +const ExitButton = styled(Image)` + margin-left: 17rem; +`; +const LogoutBox = styled.div` + ${flex.CENTER}; + margin: 7% 0 0 0; + border-radius: 5%; + color: ${theme.black}; + ${font.H4}; + background-color: #f1f3f5; + padding: 2%; + cursor: pointer; +`; + +export default SettingModal; diff --git a/src/components/common/Header/index.tsx b/src/components/common/Header/index.tsx index 3e84ef16..145a1dd9 100644 --- a/src/components/common/Header/index.tsx +++ b/src/components/common/Header/index.tsx @@ -3,7 +3,7 @@ import styled from "styled-components"; import { theme, flex } from "@/styles"; import { Logo, Setting } from "@/assets/icons"; import Navigation from "./Navigation"; -import SettingModal from "./@setting/setting"; +import SettingModal from "./@setting/layouts/setting"; const Header = () => { const [isSettingModalOpen, setSettingModalOpen] = useState(false); From 783877b9c297ce5ed18556fe8039e65b3298c427 Mon Sep 17 00:00:00 2001 From: youngeunkim Date: Wed, 3 Jan 2024 10:24:59 +0900 Subject: [PATCH 3/9] =?UTF-8?q?refactor:=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/Header/@setting/hooks/index.ts | 1 + .../Header/@setting/hooks/useSettingModal.tsx | 21 ++++++ .../common/Header/@setting/setting.tsx | 64 ------------------- src/components/common/Header/index.tsx | 14 ++-- 4 files changed, 26 insertions(+), 74 deletions(-) create mode 100644 src/components/common/Header/@setting/hooks/index.ts create mode 100644 src/components/common/Header/@setting/hooks/useSettingModal.tsx delete mode 100644 src/components/common/Header/@setting/setting.tsx diff --git a/src/components/common/Header/@setting/hooks/index.ts b/src/components/common/Header/@setting/hooks/index.ts new file mode 100644 index 00000000..258ce90c --- /dev/null +++ b/src/components/common/Header/@setting/hooks/index.ts @@ -0,0 +1 @@ +export { default as useSettingModal } from "./useSettingModal"; diff --git a/src/components/common/Header/@setting/hooks/useSettingModal.tsx b/src/components/common/Header/@setting/hooks/useSettingModal.tsx new file mode 100644 index 00000000..8425f257 --- /dev/null +++ b/src/components/common/Header/@setting/hooks/useSettingModal.tsx @@ -0,0 +1,21 @@ +import { useState } from "react"; + +const useSettingModal = () => { + const [isSettingModalOpen, setSettingModalOpen] = useState(false); + + const openSettingModal = () => { + setSettingModalOpen(true); + }; + + const closeSettingModal = () => { + setSettingModalOpen(false); + }; + + return { + isSettingModalOpen, + openSettingModal, + closeSettingModal, + }; +}; + +export default useSettingModal; diff --git a/src/components/common/Header/@setting/setting.tsx b/src/components/common/Header/@setting/setting.tsx deleted file mode 100644 index 5a264f85..00000000 --- a/src/components/common/Header/@setting/setting.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import React from "react"; -import styled from "styled-components"; -import Image from "next/image"; -import { Back } from "@/assets/images"; -import { theme, flex, font } from "@/styles"; - -interface SettingModalProps { - onClose: () => void; -} - -const SettingModal = ({ onClose }: SettingModalProps) => { - return ( - - - - 설정 - - - 로그아웃 - - - ); -}; - -const ModalOverlay = styled.div` - position: fixed; - top: 0; - left: 0; - ${flex.CENTER}; - width: 100%; - height: 100%; - background: rgba(0, 0, 0, 0.5); -`; - -const ModalContent = styled.div` - background-color: ${theme.white}; - padding: 1.5%; - border-radius: 3%; -`; - -const SettingBox = styled.div` - ${flex.VERTICAL} -`; -const SettingText = styled.p` - ${flex.CENTER}; - ${font.H4}; -`; -const ExitButton = styled(Image)` - margin-left: 17rem; -`; -const LogoutBox = styled.div` - ${flex.CENTER}; - margin: 7% 0 0 0; - border-radius: 5%; - color: ${theme.black}; - ${font.H4}; - background-color: #f1f3f5; - padding: 2%; - cursor: pointer; -`; - -export default SettingModal; diff --git a/src/components/common/Header/index.tsx b/src/components/common/Header/index.tsx index 145a1dd9..70b8ef1c 100644 --- a/src/components/common/Header/index.tsx +++ b/src/components/common/Header/index.tsx @@ -1,20 +1,14 @@ -import React, { useState } from "react"; +import React from "react"; import styled from "styled-components"; import { theme, flex } from "@/styles"; import { Logo, Setting } from "@/assets/icons"; import Navigation from "./Navigation"; import SettingModal from "./@setting/layouts/setting"; +import { useSettingModal } from "./@setting/hooks"; const Header = () => { - const [isSettingModalOpen, setSettingModalOpen] = useState(false); - - const openSettingModal = () => { - setSettingModalOpen(true); - }; - - const closeSettingModal = () => { - setSettingModalOpen(false); - }; + const { isSettingModalOpen, openSettingModal, closeSettingModal } = + useSettingModal(); return ( From 8814fb94785a8f66d8bcbd8d540aad8b19f523dc Mon Sep 17 00:00:00 2001 From: youngeunkim Date: Wed, 3 Jan 2024 14:09:19 +0900 Subject: [PATCH 4/9] style: css --- .../Header/@setting/layouts/setting.tsx | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/components/common/Header/@setting/layouts/setting.tsx b/src/components/common/Header/@setting/layouts/setting.tsx index 5a264f85..5e159dc8 100644 --- a/src/components/common/Header/@setting/layouts/setting.tsx +++ b/src/components/common/Header/@setting/layouts/setting.tsx @@ -10,7 +10,7 @@ interface SettingModalProps { const SettingModal = ({ onClose }: SettingModalProps) => { return ( - + 설정 @@ -20,18 +20,15 @@ const SettingModal = ({ onClose }: SettingModalProps) => { 로그아웃 - + ); }; -const ModalOverlay = styled.div` - position: fixed; - top: 0; - left: 0; +const Modal = styled.div` ${flex.CENTER}; width: 100%; height: 100%; - background: rgba(0, 0, 0, 0.5); + background: #00000080; `; const ModalContent = styled.div` @@ -43,22 +40,29 @@ const ModalContent = styled.div` const SettingBox = styled.div` ${flex.VERTICAL} `; + const SettingText = styled.p` ${flex.CENTER}; ${font.H4}; `; + const ExitButton = styled(Image)` margin-left: 17rem; `; + const LogoutBox = styled.div` ${flex.CENTER}; margin: 7% 0 0 0; + padding: 2%; border-radius: 5%; + background-color: #f1f3f5; color: ${theme.black}; ${font.H4}; - background-color: #f1f3f5; - padding: 2%; cursor: pointer; + + &:hover { + background-color: ${theme.content}; + } `; export default SettingModal; From 48be7cc21cc4315712f844586f0b5c8d3f912059 Mon Sep 17 00:00:00 2001 From: youngeunkim Date: Wed, 3 Jan 2024 16:44:22 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gtag.d.ts | 3 -- package.json | 3 +- src/app/layout.tsx | 25 ++---------- .../Header/@setting/layouts/setting.tsx | 3 ++ src/components/common/Header/index.tsx | 1 - src/hooks/useGtag.ts | 40 ------------------- yarn.lock | 37 ++++++----------- 7 files changed, 20 insertions(+), 92 deletions(-) diff --git a/gtag.d.ts b/gtag.d.ts index e02ce14e..e69de29b 100644 --- a/gtag.d.ts +++ b/gtag.d.ts @@ -1,3 +0,0 @@ -/// - -declare module "gtag.js"; diff --git a/package.json b/package.json index c638524d..00817ca0 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "test:ci": "jest --ci" }, "dependencies": { - "@playwright/test": "^1.29.1", + "@playwright/test": "1.34.3", "@sentry/nextjs": "^7.90.0", "@tanstack/react-query": "^4.35.3", "@testing-library/jest-dom": "^6.1.5", @@ -75,7 +75,6 @@ "@semantic-release/npm": "^9.0.1", "@semantic-release/release-notes-generator": "^10.0.3", "@types/graphql": "^14.5.0", - "@types/gtag.js": "^0.0.18", "@types/jest": "^29.2.4", "@types/react-beautiful-dnd": "^13.1.3", "@types/react-slick": "^0.23.12", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 8f60a6d5..c431ddd4 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,7 +1,5 @@ import Provider from "@/provider/MainProvider"; -import React from "react"; -import * as gtag from "@/hooks/useGtag"; -import Script from "next/script"; +import React, { useEffect } from "react"; export const metadata = { title: "BSM", @@ -13,27 +11,10 @@ export default function RootLayout({ }: { children: React.ReactNode; }) { - gtag.useGtag(); + useEffect(() => {}, []); + return ( -