Added login form main

This commit is contained in:
Nikolaj Frey 2024-03-18 01:11:19 +11:00
parent de4063602a
commit 59c04276ac
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,47 @@
import React, { useState } from "react"
import { Flex, FormControl, Input } from "@chakra-ui/react"
export const Login = (props) => {
const [email, setEmail] = useState("")
const [password, setPassword] = useState("")
const handleLogin = () => {
// handle login
}
return (
<>
<Flex flexDirection="column" gap={4} width="auto">
<FormControl>
<Input
onChange={(e) => setEmail(e.target.value)}
placeholder="Email"
type="email"
value={email}
/>
</FormControl>
<FormControl>
<Input
onChange={(e) => setPassword(e.target.value)}
placeholder="Password"
type="password"
value={password}
/>
</FormControl>
<Flex
width="100%"
color="white"
background="chakras.violet"
borderRadius={6}
cursor="pointer"
paddingX={5}
paddingY={2}
>
Login
</Flex>
</Flex>
</>
)
}

21
app/app/routes/login.tsx Normal file
View File

@ -0,0 +1,21 @@
import { Flex } from "@chakra-ui/react"
import { Login } from "~/components/Login/Login"
export default function login() {
const template = (
<>
<Flex
alignItems="center"
justifyContent="center"
width="100%"
height="100%"
minHeight="100vh"
>
<Login></Login>
</Flex>
</>
)
return template
}