From d645287073d7b8938026d670ea5b8159cd2ef4a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EA=B1=B4=EA=B7=9C?= Date: Wed, 29 May 2024 22:05:52 +0900 Subject: [PATCH 001/162] =?UTF-8?q?feat:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=EC=9E=90=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99=ED=95=A0=20?= =?UTF-8?q?=EC=88=98=20=EC=9E=88=EB=8A=94=20=EB=A7=81=ED=81=AC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20(auth/admin)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 동일한 로그인 접근제어를 적용해야 하므로 (auth)에 admin/login 도메인 추가 --- FE/public/icons/arrowRight.svg | 4 ++++ FE/src/app/(auth)/admin/login/page.tsx | 12 ++++++++++++ FE/src/components/login/RightSection.tsx | 11 +++++++++++ 3 files changed, 27 insertions(+) create mode 100644 FE/public/icons/arrowRight.svg create mode 100644 FE/src/app/(auth)/admin/login/page.tsx diff --git a/FE/public/icons/arrowRight.svg b/FE/public/icons/arrowRight.svg new file mode 100644 index 00000000..ecb3dbb8 --- /dev/null +++ b/FE/public/icons/arrowRight.svg @@ -0,0 +1,4 @@ + + + + diff --git a/FE/src/app/(auth)/admin/login/page.tsx b/FE/src/app/(auth)/admin/login/page.tsx new file mode 100644 index 00000000..a70e0120 --- /dev/null +++ b/FE/src/app/(auth)/admin/login/page.tsx @@ -0,0 +1,12 @@ +import LoginLeftSection from "@/components/login/LeftSection"; +import LoginRightSection from "@/components/login/RightSection"; + +const LoginPage = () => { + return ( +
+ + +
+ ); +}; +export default LoginPage; diff --git a/FE/src/components/login/RightSection.tsx b/FE/src/components/login/RightSection.tsx index 72a2c867..8bd2aee1 100644 --- a/FE/src/components/login/RightSection.tsx +++ b/FE/src/components/login/RightSection.tsx @@ -1,3 +1,5 @@ +import Image from "next/image"; +import Link from "../common/Link"; import Title from "../common/Title"; import GuestLoginButton from "./guest/GuestLoginButton"; import LoginSection from "./slack/LoginSection"; @@ -19,6 +21,15 @@ const LoginRightSection = () => { title="게스트모드로 EEOS 둘러보기" loginBtnComponent={} /> + + 관리자 로그인 + arrow right to go admin login page + ); From ff143476819107a9e0600435a1115674c946491f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EA=B1=B4=EA=B7=9C?= Date: Wed, 29 May 2024 23:06:35 +0900 Subject: [PATCH 002/162] =?UTF-8?q?refactor:=20conpound=20pattern=EC=9D=84?= =?UTF-8?q?=20=EC=82=AC=EC=9A=A9=ED=95=98=EC=97=AC=20=EC=A4=91=EB=B3=B5?= =?UTF-8?q?=EB=90=9C=20=EB=A1=9C=EC=A7=81=20=EC=A0=9C=EA=B1=B0=20(login)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기존 약간의 스타일과 동작의 차이로 인한 불필요한 컴포넌트 생성을 conpound pattern을 적용하여 한 파일 내에서 관리하도록 변경 #31 --- .../SlackLoginButton.tsx => LoginSection.tsx} | 40 +++++++++++++++---- FE/src/components/login/RightSection.tsx | 37 ----------------- .../login/guest/GuestLoginButton.tsx | 12 ------ .../login/guest/GuestLoginSection.tsx | 12 ------ .../components/login/slack/LoginSection.tsx | 17 -------- 5 files changed, 33 insertions(+), 85 deletions(-) rename FE/src/components/login/{slack/SlackLoginButton.tsx => LoginSection.tsx} (52%) delete mode 100644 FE/src/components/login/RightSection.tsx delete mode 100644 FE/src/components/login/guest/GuestLoginButton.tsx delete mode 100644 FE/src/components/login/guest/GuestLoginSection.tsx delete mode 100644 FE/src/components/login/slack/LoginSection.tsx diff --git a/FE/src/components/login/slack/SlackLoginButton.tsx b/FE/src/components/login/LoginSection.tsx similarity index 52% rename from FE/src/components/login/slack/SlackLoginButton.tsx rename to FE/src/components/login/LoginSection.tsx index b1f4ad75..4cb075a7 100644 --- a/FE/src/components/login/slack/SlackLoginButton.tsx +++ b/FE/src/components/login/LoginSection.tsx @@ -1,10 +1,23 @@ -"use client"; - import { useSearchParams } from "next/navigation"; import { useEffect } from "react"; -import StyledLoginButton from "../ui/StyledLoginButton"; +import StyledLoginButton from "./ui/StyledLoginButton"; import { useSlackLoginMutation } from "@/hooks/query/useAuthQuery"; +interface LoginSectionProps { + title: string; + children: React.ReactNode; +} +//Wrapper +const LoginSection = ({ title, children }: LoginSectionProps) => { + return ( +
+

{title}

+ {children} +
+ ); +}; + +//Children_1 SlackLoginButton const SlackLoginButton = () => { const clientId = process.env.NEXT_PUBLIC_SLACK_CLIENT_ID; const redirectUri = process.env.NEXT_PUBLIC_SLACK_REDIRECT_URI; @@ -17,9 +30,7 @@ const SlackLoginButton = () => { const { mutate: loginSlack } = useSlackLoginMutation(); useEffect(() => { - if (code) { - loginSlack({ code, redirect_uri: redirectUri }); - } + if (code) loginSlack({ code, redirect_uri: redirectUri }); }, [code]); return ( @@ -32,4 +43,19 @@ const SlackLoginButton = () => { ); }; -export default SlackLoginButton; +//Children_2 GuestLoginButton +const GuestLoginButton = () => { + return ( + + ); +}; + +LoginSection.SlackLoginButton = SlackLoginButton; +LoginSection.GuestLoginButton = GuestLoginButton; + +export default LoginSection; diff --git a/FE/src/components/login/RightSection.tsx b/FE/src/components/login/RightSection.tsx deleted file mode 100644 index 8bd2aee1..00000000 --- a/FE/src/components/login/RightSection.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import Image from "next/image"; -import Link from "../common/Link"; -import Title from "../common/Title"; -import GuestLoginButton from "./guest/GuestLoginButton"; -import LoginSection from "./slack/LoginSection"; -import SlackLoginButton from "./slack/SlackLoginButton"; - -const LoginRightSection = () => { - return ( -