Skip to content

Commit f05bb80

Browse files
committed
Login component
1 parent 1a0e772 commit f05bb80

File tree

4 files changed

+5373
-2
lines changed

4 files changed

+5373
-2
lines changed

app/page.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
import React from "react";
2-
import { Button, H1, H2, H3, H4, H5, H6, Input, Textarea, Accordion, BasicCard, ProductCard, Avatar } from "@/components";
2+
import {
3+
Button,
4+
H1,
5+
H2,
6+
H3,
7+
H4,
8+
H5,
9+
H6,
10+
Input,
11+
Textarea,
12+
Accordion,
13+
BasicCard,
14+
ProductCard,
15+
Avatar,
16+
} from "@/components";
17+
import { Login } from "@/components/Login";
318

419
export default function page() {
520
return (
6-
<div className="container max-w-6xl mx-auto">
21+
<div className="container max-w-6xl mx-auto mb-10">
722
<H1>Welcome to RetroUI</H1>
823

924
<div className="space-y-8 mt-12">
@@ -46,6 +61,11 @@ export default function page() {
4661
<div className="h-4"></div>
4762
<ProductCard />
4863
</div>
64+
65+
<div>
66+
<H3>Login</H3>
67+
<Login />
68+
</div>
4969
</div>
5070
</div>
5171
);

components/Login/Login.tsx

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
"use client";
2+
import React, { ReactElement, useState } from "react";
3+
4+
export function Login(): ReactElement {
5+
const [customClass, setCustomClass] = useState(false);
6+
7+
const handleClick = () => {
8+
setCustomClass(true);
9+
setTimeout(() => {
10+
setCustomClass(false);
11+
}, 150);
12+
};
13+
return (
14+
<div className="max-w-80 bg-rose-400 border-2 border-black shadow-md ">
15+
<div className="font-head text-3xl text-center px-4 py-2 my-2 ">
16+
Login
17+
</div>
18+
<form
19+
onSubmit={(e) => {
20+
e.preventDefault();
21+
}}
22+
className="flex flex-col gap-8"
23+
>
24+
<div className="flex flex-col items-center justify-center">
25+
<label htmlFor="email" className="w-11/12">
26+
Email
27+
</label>
28+
<input
29+
id="email"
30+
type="email"
31+
placeholder="Email"
32+
className="px-4 py-2 w-11/12 font-body border-2 border-black shadow-md transition focus:outline-none focus:shadow-xs "
33+
/>
34+
</div>
35+
<div className="flex flex-col items-center justify-center">
36+
<label htmlFor="email" className="w-11/12">
37+
Password
38+
</label>
39+
<input
40+
type="password"
41+
placeholder="Password"
42+
className={`px-4 py-2 w-11/12 font-body border-2 border-black shadow-md transition focus:outline-none focus:shadow-xs`}
43+
/>
44+
</div>
45+
<div className="flex flex-col items-center justify-center py-4">
46+
<button
47+
onClick={handleClick}
48+
className={`px-6 py-2 w-1/2 text-sm font-head bg-primary-400 rounded-full border-2 border-black shadow-md transition-all ${
49+
customClass ? "bg-primary-500 scale-95 shadow-xs" : ""
50+
}`}
51+
>
52+
submit
53+
</button>
54+
<p className="px-4 py-2 ">
55+
Don&apos;t have an account? <a href="/">sign-in</a>
56+
</p>
57+
</div>
58+
</form>
59+
</div>
60+
);
61+
}

components/Login/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./Login";

0 commit comments

Comments
 (0)