Skip to content

Commit 06de9aa

Browse files
committed
아이디 패스워드 입력되도록 수정
1 parent a52d492 commit 06de9aa

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

src/modules/Home/Home.tsx

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,20 @@
1-
import MainBanner from "./components/MainBanner";
21
import { Container, Typography, Theme, Input, Button } from "@mui/material";
32
import { toast, ToastContainer } from "react-toastify";
4-
import PseudoLabLogo from "../../components/common/PseudoLabLogo";
53
import { styled } from "@mui/system";
4+
import { useState } from "react";
65

76
const StyledContainer = styled(Container)({
87
textAlign: "center",
98
padding: (theme: Theme) => theme.spacing(4),
109
});
1110

12-
const Title = styled(Typography)({
13-
fontSize: "2.5rem",
14-
fontWeight: "bold",
15-
marginBottom: (theme: Theme) => theme.spacing(2),
16-
color: (theme: Theme) => theme.palette.primary.main,
17-
});
18-
19-
const Description = styled(Typography)({
20-
fontSize: "1.2rem",
21-
marginBottom: (theme: Theme) => theme.spacing(4),
22-
});
23-
2411
const InputBox = styled(Input)({
2512
marginTop: "1rem",
2613
});
2714

2815
const Home = () => {
29-
let loginId = "";
30-
let password = "";
16+
const [loginId, setLoginId] = useState("");
17+
const [password, setPassword] = useState("");
3118
const handLogin = () => {
3219
console.log(loginId);
3320
console.log(password);
@@ -89,15 +76,18 @@ const Home = () => {
8976
placeholder="아이디 입력"
9077
value={loginId}
9178
onChange={async (event: React.ChangeEvent<HTMLInputElement>) => {
92-
loginId = event.target.value;
79+
setLoginId(event.target.value);
9380
}}
9481
></InputBox>
9582

83+
<br />
84+
9685
<InputBox
9786
placeholder="비밀번호 입력"
9887
value={password}
88+
type="Password"
9989
onChange={async (event: React.ChangeEvent<HTMLInputElement>) => {
100-
password = event.target.value;
90+
setPassword(event.target.value);
10191
}}
10292
></InputBox>
10393
<br />

0 commit comments

Comments
 (0)