Skip to content

Commit

Permalink
[FEAT] Login로직 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
chobuzz committed Mar 16, 2024
1 parent 5e762b5 commit a2640af
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 31 additions & 1 deletion src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,52 @@ import styled from "styled-components";
import { CommonInput, CommonButton } from "../styles/globalStyles";
import { useNavigate } from "react-router";
import { LoginSignUpContainer } from "../styles/LoginSignUp.style";
import { useState, ChangeEvent } from "react";

export default function Login() {
const [email, setEmail] = useState<string>("abcd");
const [password, setPassword] = useState<string>("dddd");

const navigate = useNavigate();

const goToSignUp = () => {
navigate("/signUp");
};

const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
const { name, value } = e.target;
switch (name) {
case "email":
setEmail(value);
break;
case "password":
setPassword(value);
break;
default:
break;
}
};

return (
<LoginPageContainer>
<h1>LOGIN</h1>
<CommonInput type="email" placeholder="Email" required></CommonInput>
<CommonInput
id="eamil"
type="email"
name="email"
placeholder="Email"
required
onChange={handleChange}
value={email}
></CommonInput>
<CommonInput
id="password"
type="password"
name="password"
placeholder="Password"
required
onChange={handleChange}
value={password}
></CommonInput>
<LoginButton>로그인</LoginButton>
<p onClick={goToSignUp}>회원가입</p>
Expand Down
2 changes: 2 additions & 0 deletions src/utils/pixelToRem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ const ROOT_FONT_SIZE = 16;
const pixelToRem = (pixel: number): string => {
return pixel / ROOT_FONT_SIZE + "rem";
};

export default pixelToRem;

0 comments on commit a2640af

Please sign in to comment.