signup.tsx 2.84 KB
Newer Older
Kim, MinGyu's avatar
signup    
Kim, MinGyu committed
1
2
import React, { useState } from "react";
import { Link } from "react-router-dom";
Lee Soobeom's avatar
Lee Soobeom committed
3

Kim, MinGyu's avatar
signup    
Kim, MinGyu committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
function PasswordUpdate() {
  const [password, setPassword] = useState("");
  const [confirm, setConfirm] = useState("");

  const handleSubmit = () => {

    if (password && confirm){
    
      if (password==confirm) {
        alert("비밀번호가 일치합니다.");
      } else {
        alert("비밀번호가 다릅니다.");
      }
    }else {
      alert("비밀번호가 입력되지 않았습니다.")
    }

  };

  return (
    <form onSubmit={handleSubmit}>
      <input
        className="border border-black"
        type="password"
        name="password"
        value={password}
        onChange={(e) => setPassword(e.target.value )}
      />
      <input
        className="border border-black"
        type="confirm"
        name="confirm"
        value={confirm}
        onChange={(e) => setConfirm(e.target.value )}
      />
      <button type="submit">비밀번호 확인</button>
    </form>
  );
}



export default function Signup () {
  return(

  <div className="gap-5">
    
      <div className="flex flex-col gap-2">
        <div className="p-12 w-1/2 h-1/2 md:w-40 md:h-1/6 bg-red-400 place-self-center rounded-2xl">
          <Link to="/">Travel Report</Link>
        </div>
          
        <div className="place-self-center py-3 border-b border-white ">
          <input className="placeholder:text-slate-300
            bg-white border border-slate-500 rounded-2xl
            py-2 pl-9 pr-3 
            focus:border-black" placeholder="ID " type="text"/>
        </div>
Kim, MinGyu's avatar
Kim, MinGyu committed
62
          
Kim, MinGyu's avatar
signup    
Kim, MinGyu committed
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
        <div className="place-self-center py-3 border-b border-white ">
          <input className="placeholder:text-slate-300
            bg-white border border-slate-500 rounded-2xl
            py-2 pl-9 pr-3 
            focus:border-black
            " name="firstPassword"placeholder="비밀번호" type="text"/>
        </div>
        <div className="place-self-center py-3 border-b border-white ">
          <input className="placeholder:text-slate-300
            bg-white border border-slate-500 rounded-2xl
            py-2 pl-9 pr-3 
            focus:border-black"placeholder="비밀번호 확인" type="text"/>
        </div>
        <div className="showText place-self-center">
        <PasswordUpdate />
        </div>
        <div className="place-self-center py-3 border-b border-white 
          ">
          <input className="placeholder:text-slate-300
            bg-white border border-slate-500 rounded-2xl
            py-2 pl-9 pr-3 
            focus:border-black
            " placeholder="Id" type="text" name="Id"/>
        </div>
        <button className="place-self-center py-3 border-b border-white 
            ">
              회원가입 버튼
        </button>
            
      </div> 
    
    
  </div>
  )
}
//출처 : //https://www.daleseo.com/react-forms/