diff --git a/src/components/Auth/Auth.tsx b/src/components/Auth/Auth.tsx index bd73856..39ef6c6 100644 --- a/src/components/Auth/Auth.tsx +++ b/src/components/Auth/Auth.tsx @@ -3,7 +3,7 @@ import { useAppDispatch, useAppSelector } from "@/types"; import { type RootState } from "@/redux/store"; import { Board } from "@/components/Board"; import { loginThunk } from "@/redux/auth/loginThunk"; -import style from "./Auth.module.scss"; +import { LoginPage } from "@/components/Auth/LoginPage"; export const AuthPage = () => { const [deviceId, setDeviceId] = useState(""); @@ -33,50 +33,14 @@ export const AuthPage = () => { setPin(""); }; - if (isLoggedIn) { - return ; - } - - return ( -
-
-

Zabo Board Login

-
-

- Zabo Board 서비스를 이용하기 위해서는 등록된 device Id와 PIN을 - 입력하세요. -
- Zabo Board 서비스를 등록하기 위해서는 zabo.sparcs.org 채널톡으로 - 문의해주세요. -

-
- - -
- -
{errorMessage}
-
-
+ return isLoggedIn ? ( + + ) : ( + ); }; diff --git a/src/components/Auth/LoginPage.tsx b/src/components/Auth/LoginPage.tsx new file mode 100644 index 0000000..f3b2da7 --- /dev/null +++ b/src/components/Auth/LoginPage.tsx @@ -0,0 +1,53 @@ +import type { ChangeEvent } from "react"; +import style from "./Auth.module.scss"; + +type LoginPageProps = { + onDeviceIdChange: (e: ChangeEvent) => void; + onPinChange: (e: ChangeEvent) => void; + onSubmitHandler: () => void; + errorMessage: string; +}; + +export const LoginPage = ({ + onDeviceIdChange, + onPinChange, + onSubmitHandler, + errorMessage, +}: LoginPageProps) => ( +
+
+

Zabo Board Login

+
+

+ Zabo Board 서비스를 이용하기 위해서는 등록된 device Id와 PIN을 + 입력하세요. +
+ Zabo Board 서비스를 등록하기 위해서는 zabo.sparcs.org 채널톡으로 + 문의해주세요. +

+
+ + +
+ +
{errorMessage}
+
+
+);