feat: login page and input
This commit is contained in:
1
src/components/ui/Input.module.scss
Normal file
1
src/components/ui/Input.module.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
@reference "../../index.scss";
|
||||||
17
src/components/ui/Input.tsx
Normal file
17
src/components/ui/Input.tsx
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { FunctionComponent } from "preact";
|
||||||
|
import { tv } from "tailwind-variants";
|
||||||
|
|
||||||
|
const input = tv({
|
||||||
|
base: "rounded-md border border-gray-300 p-2",
|
||||||
|
});
|
||||||
|
|
||||||
|
interface InputProps {
|
||||||
|
isPassword?: boolean;
|
||||||
|
placeholder?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Input: FunctionComponent<InputProps> = ({ isPassword = false, placeholder = "" }: InputProps) => {
|
||||||
|
return <input type={isPassword ? "password" : "text"} class={input()} placeholder={placeholder} />;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Input;
|
||||||
5
src/pages/login.module.scss
Normal file
5
src/pages/login.module.scss
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
@reference "../index.scss";
|
||||||
|
|
||||||
|
.login_container {
|
||||||
|
@apply flex flex-row justify-center gap-2 align-middle;
|
||||||
|
}
|
||||||
15
src/pages/login.tsx
Normal file
15
src/pages/login.tsx
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import Button from "@/components/ui/Button";
|
||||||
|
import Input from "@/components/ui/Input";
|
||||||
|
import { FunctionComponent } from "preact";
|
||||||
|
import classes from "./login.module.scss";
|
||||||
|
const LoginPage: FunctionComponent = () => {
|
||||||
|
return (
|
||||||
|
<div class={classes.login_container}>
|
||||||
|
<Input placeholder="Login" />
|
||||||
|
<Input isPassword placeholder="Password" />
|
||||||
|
<Button onClick={() => {}}>Login</Button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LoginPage;
|
||||||
Reference in New Issue
Block a user