Skip to content

Commit

Permalink
Feat: 로그인 화면 개발
Browse files Browse the repository at this point in the history
1. 로그인 화면 퍼블리싱
2. 로그인 버튼 mock 이벤트 바인딩
3. 비밀번호를 잊으셨습니까 클릭시 비밀번호 찾기로 이동

Resolve: #11
  • Loading branch information
lth01 committed Apr 26, 2024
1 parent b71c77e commit 0569674
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 34 deletions.
19 changes: 19 additions & 0 deletions src/front/src/components/Layout/LabelSection.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default function LabelSection({className, id, label, isRequire = false, asChild = false, children, ...props}){
const wrapperClassName = `flex flex-col gap-2 items-center w-full ${className}`;
return (
<div
className={wrapperClassName}>
<div className="flex justify-start items-center w-full gap-x-1">
<span className="font-medium">
{label}
</span>
{
isRequire ?
<span className="text-rose-600">*</span>
: <></>
}
</div>
{asChild ? children : <></>}
</div>
);
}
49 changes: 19 additions & 30 deletions src/front/src/routes/Login.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Button } from "@/components/ui/button";
import { useContext } from "react";
import { useNavigate } from "react-router-dom";
import { GlobalContext } from "..";
import { Link } from "react-router-dom";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import LabelSection from "@/components/Layout/LabelSection";

const Login = () =>{
//라우팅 네비게이터
Expand All @@ -14,37 +17,23 @@ const Login = () =>{
setLogin(true);
nevigate("/");
}

const goSignup = () =>{
nevigate("/signup")
}


return (
<main className="flex h-screen">
<section className=" flex-grow-[6] bg-[#6866EB] px-16 py-24 text-white ">
<h1 className="text-6xl font-bold">About Us</h1>
<p className="mt-48 text-4xl font-bold grid gap-4">
<h2>1</h2>
<h2>2</h2>
<h2>3</h2>
<h2>4</h2>
</p>
</section>
<section className="flex-grow-[4] login flex flex-col items-center justify-center">
<div className="w-full text-4xl font-bold text-white">
<h2 className="text-center text-black">Get Started</h2>
<div className="flex justify-center gap-4 mt-4">
<Button className="bg-[#6866EB] w-48 hover:bg-violet-600">
<div onClick={doLogin}>
Login
</div>
</Button>
<Button className="bg-[#6866EB] w-48 hover:bg-violet-600">
<div onClick={goSignup}>
Signup
</div>
</Button>
</div>
<main id="login-wrap" className="flex flex-col min-h-screen items-center">
<section className="w-500 py-20 px-10 mt-60 bg-white border">
<LabelSection asChild label="Email">
<Input id="tBox_email" type="email" placeholder="Email Address"></Input>
</LabelSection>
<LabelSection asChild label="Password" className="mt-4">
<Input id="tBox_pwd" type="password" placeholder="password"></Input>
</LabelSection>
{/* 버튼은 onClick 콜백 동작 불가 */}
<Button asChild className="bg-[#6866EB] mt-4 w-full hover:bg-violet-600">
<div onClick={doLogin}>로그인</div>
</Button>
<div className="flex justify-center mt-4">
<Link to="/findPassword" className="text-black/65">비밀번호를 잊으셨나요?</Link>
</div>
</section>
</main>
Expand Down
8 changes: 4 additions & 4 deletions src/front/src/routes/Main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ const Main = () =>{
},[isLogin]);

const doLogin = () =>{
setLogin(true);
}
nevigate("/login");
}

const goSignup = () =>{
nevigate("/signup");
}
nevigate("/signup");
}

return (
isLogin ?
Expand Down

0 comments on commit 0569674

Please sign in to comment.