.
This commit is contained in:
parent
d288dc697a
commit
11ca145a44
@ -1 +1,2 @@
|
|||||||
export * from "./error-page";
|
export * from "./error-page";
|
||||||
|
export * from "./login-form";
|
||||||
|
|||||||
58
apps/web/src/pages/login-form.tsx
Normal file
58
apps/web/src/pages/login-form.tsx
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import { Button } from "@repo/shadcn-ui/components/button";
|
||||||
|
import {
|
||||||
|
Card,
|
||||||
|
CardContent,
|
||||||
|
CardDescription,
|
||||||
|
CardHeader,
|
||||||
|
CardTitle,
|
||||||
|
} from "@repo/shadcn-ui/components/card";
|
||||||
|
import { Field, FieldDescription, FieldGroup, FieldLabel } from "@repo/shadcn-ui/components/field";
|
||||||
|
import { Input } from "@repo/shadcn-ui/components/input";
|
||||||
|
import { cn } from "@repo/shadcn-ui/lib/utils";
|
||||||
|
|
||||||
|
export function LoginForm({ className, ...props }: React.ComponentProps<"div">) {
|
||||||
|
return (
|
||||||
|
<div className={cn("flex flex-col gap-6", className)} {...props}>
|
||||||
|
<Card>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle>Login to your account</CardTitle>
|
||||||
|
<CardDescription>Enter your email below to login to your account</CardDescription>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<form>
|
||||||
|
<FieldGroup>
|
||||||
|
<Field>
|
||||||
|
<FieldLabel htmlFor='email'>Email</FieldLabel>
|
||||||
|
<Input id='email' type='email' placeholder='m@example.com' required />
|
||||||
|
</Field>
|
||||||
|
<Field>
|
||||||
|
<div className='flex items-center'>
|
||||||
|
<FieldLabel htmlFor='password'>Password</FieldLabel>
|
||||||
|
<a
|
||||||
|
// biome-ignore lint/a11y/useValidAnchor: <explanation>
|
||||||
|
href='#'
|
||||||
|
className='ml-auto inline-block text-sm underline-offset-4 hover:underline'
|
||||||
|
>
|
||||||
|
Forgot your password?
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<Input id='password' type='password' required />
|
||||||
|
</Field>
|
||||||
|
<Field>
|
||||||
|
<Button type='submit'>Login</Button>
|
||||||
|
<Button variant='outline' type='button'>
|
||||||
|
Login with Google
|
||||||
|
</Button>
|
||||||
|
<FieldDescription className='text-center'>
|
||||||
|
Don't have an account?{" "}
|
||||||
|
{/** biome-ignore lint/a11y/useValidAnchor: <explanation> */}
|
||||||
|
<a href='#'>Sign up</a>
|
||||||
|
</FieldDescription>
|
||||||
|
</Field>
|
||||||
|
</FieldGroup>
|
||||||
|
</form>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,8 +1,8 @@
|
|||||||
import { ModuleRoutes } from "@/components/module-routes";
|
|
||||||
import { IModuleClient } from "@erp/core/client";
|
import { IModuleClient } from "@erp/core/client";
|
||||||
import { AppLayout } from "@repo/rdx-ui/components";
|
import { AppLayout } from "@repo/rdx-ui/components";
|
||||||
import { Navigate, Route, createBrowserRouter, createRoutesFromElements } from "react-router-dom";
|
import { createBrowserRouter, createRoutesFromElements, Navigate, Route } from "react-router-dom";
|
||||||
import { ErrorPage } from "../pages";
|
import { ModuleRoutes } from "@/components/module-routes";
|
||||||
|
import { ErrorPage, LoginForm } from "../pages";
|
||||||
import { modules } from "../register-modules"; // Aquí ca
|
import { modules } from "../register-modules"; // Aquí ca
|
||||||
|
|
||||||
function groupModulesByLayout(modules: IModuleClient[]) {
|
function groupModulesByLayout(modules: IModuleClient[]) {
|
||||||
@ -37,6 +37,7 @@ export const getAppRouter = () => {
|
|||||||
{/* Auth Layout */}
|
{/* Auth Layout */}
|
||||||
<Route path='/auth'>
|
<Route path='/auth'>
|
||||||
<Route index element={<Navigate to='login' />} />
|
<Route index element={<Navigate to='login' />} />
|
||||||
|
<Route path='login' element={<LoginForm />} />
|
||||||
<Route path='*' element={<ModuleRoutes modules={grouped.auth} params={params} />} />
|
<Route path='*' element={<ModuleRoutes modules={grouped.auth} params={params} />} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user