Skip to content

Commit

Permalink
#5 sign up fixed again
Browse files Browse the repository at this point in the history
  • Loading branch information
toyaa17 committed Nov 1, 2023
1 parent f7e8dc0 commit ed2284a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
35 changes: 22 additions & 13 deletions app/(auth)/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export default function SignUp() {
const [note, setNote] = useState("")
const [type, setType] = useState("password")
const [eye, setEye] = useState("relative top-10 left-72 text-balck")
const [eyeval, setEyeval] = useState("")
const [nlink, setNlink] = useState("")
const [check, setCheck] = useState("false")

function changeStatus() {
if(type == "password") {
Expand All @@ -29,6 +30,8 @@ export default function SignUp() {
if(mssv.length == 0) {
setClassnameE("border border-red-600 hover:border-sky-500 w-full h-14 rounded-lg px-2")
setNote("Bạn phải nhập MSSV")
setCheck("false")
setNlink("")
}
else {
setClassnameE("border hover:border-sky-500 w-full h-14 rounded-lg px-2")
Expand All @@ -37,16 +40,22 @@ export default function SignUp() {
if(password.length == 0) {
setClassnameP("border border-red-600 hover:border-sky-500 w-full h-14 rounded-lg px-2")
setNote("Bạn phải nhập mật khẩu")
setCheck("false")
setNlink("")
}
else {
setClassnameP("border hover:border-sky-500 w-full h-14 rounded-lg px-2")
}

if(mssv.length == 0 && password.length == 0) {
setNote("Bạn phải nhập MSSV và mật khẩu")
setCheck("false")
setNlink("")
}
if(mssv.length > 0 && password.length > 0) {
setNote("")
setCheck("true")
setNlink("/signin")
}
}

Expand All @@ -62,18 +71,18 @@ export default function SignUp() {

<div className="mx-auto w-5/6 flex flex-col justify-center">

<div className="relative top-2 left-2 w-16">
<div className="absolute bg-white w-full px-1">
<label htmlFor="mssv" className="text-xs w-full text-red-600 font-medium">* </label>
<div className="relative top-2 left-1 w-16">
<div className="absolute bg-white w-full px-2">
<label htmlFor="mssv" className="text-xs w-full text-red-600 font-medium">* </label>
<label htmlFor="mssv" className="text-xs text-gray-400 w-full font-medium">MSSV</label>
</div>
</div> <br />

<input className={classnameE} type="text" id = "mssv" placeholder='Nhập mã số sinh viên' value={mssv} onChange={(evt) => setMssv(evt.target.value)} /> <br />

<div className="relative top-2 left-2 w-20">
<div className="absolute bg-white w-full px-1">
<label htmlFor="mssv" className="text-xs w-full text-red-600 font-medium">* </label>
<div className="relative top-2 left-1 w-20">
<div className="absolute bg-white w-full px-2">
<label htmlFor="mssv" className="text-xs w-full text-red-600 font-medium">* </label>
<label htmlFor="mssv" className="text-xs text-gray-400 w-full font-medium">Mật khẩu</label>
</div>
</div>
Expand All @@ -84,16 +93,16 @@ export default function SignUp() {

<input className={classnameP} type={type} maxLength={32} id = "password" placeholder='Nhập mật khẩu' value={password} onChange={(evt) => setPassword(evt.target.value)} /> <br />

<div className="relative top-2 left-2 w-20">
<div className="absolute bg-white w-full px-1">
<div className="relative top-2 left-1 w-20">
<div className="absolute bg-white w-full px-2">
<label htmlFor="Full Name" className="text-xs text-gray-400 w-full font-medium">Họ và tên</label>
</div>
</div> <br />
<input className="border hover:border-sky-500 w-full h-14 rounded-lg px-2" type="text" id = "Full Name" placeholder='Nhập họ và tên' /> <br />

<div className="relative top-2 left-2 w-24">
<div className="absolute bg-white w-full px-1">
<label htmlFor="email" className="text-xs text-gray-400 w-full font-medium">Email</label>
<div className="relative top-2 left-1 w-12">
<div className="absolute bg-white w-full px-2">
<label htmlFor="email" className="text-xs text-gray-400 w-full font-medium"> Email</label>
</div>
</div> <br />
<input className="border hover:border-sky-500 w-full h-14 rounded-lg px-2" type="text" id = "email" placeholder='Nhập email' /> <br />
Expand All @@ -108,7 +117,7 @@ export default function SignUp() {
</button>

<button className="font-bold bg-black hover:bg-sky-300 text-white rounded-2xl w-28 h-10"
onClick={() => handleClick()}>Next</button>
onClick={() => handleClick()}> <Link href = {nlink}>Next</Link> </button>
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion components/layouts/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ export default function Header() {
}
</div>
);
}
}

0 comments on commit ed2284a

Please sign in to comment.