chore: restructure packages of the project (#7)
* chore: restructure validation package * chore: move zod only to validation package * chore: rename packages from alparr to homarr * chore: move mantine core, dates and icons library to ui package, move most other mantine packages to seperate packages for further customization and centralization * chore: fix formatting * fix: wrong typecheck command in turbo generator * chore: fix formatting * chore: address pull request feedback * chore: fix ci check issues
This commit is contained in:
@@ -2,21 +2,21 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import { signIn } from "@homarr/auth/client";
|
||||
import { useForm, zodResolver } from "@homarr/form";
|
||||
import { useScopedI18n } from "@homarr/translation/client";
|
||||
import {
|
||||
Alert,
|
||||
Button,
|
||||
IconAlertTriangle,
|
||||
PasswordInput,
|
||||
rem,
|
||||
Stack,
|
||||
TextInput,
|
||||
} from "@mantine/core";
|
||||
import { useForm, zodResolver } from "@mantine/form";
|
||||
import { IconAlertTriangle } from "@tabler/icons-react";
|
||||
import type { z } from "zod";
|
||||
|
||||
import { signIn } from "@alparr/auth/client";
|
||||
import { useScopedI18n } from "@alparr/translation/client";
|
||||
import { signInSchema } from "@alparr/validation";
|
||||
} from "@homarr/ui";
|
||||
import type { z } from "@homarr/validation";
|
||||
import { validation } from "@homarr/validation";
|
||||
|
||||
export const LoginForm = () => {
|
||||
const t = useScopedI18n("user");
|
||||
@@ -24,7 +24,7 @@ export const LoginForm = () => {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [error, setError] = useState<string>();
|
||||
const form = useForm<FormType>({
|
||||
validate: zodResolver(signInSchema),
|
||||
validate: zodResolver(validation.user.signIn),
|
||||
initialValues: {
|
||||
name: "",
|
||||
password: "",
|
||||
@@ -79,4 +79,4 @@ export const LoginForm = () => {
|
||||
);
|
||||
};
|
||||
|
||||
type FormType = z.infer<typeof signInSchema>;
|
||||
type FormType = z.infer<typeof validation.user.signIn>;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Card, Center, Stack, Text, Title } from "@mantine/core";
|
||||
|
||||
import { getScopedI18n } from "@alparr/translation/server";
|
||||
import { getScopedI18n } from "@homarr/translation/server";
|
||||
import { Card, Center, Stack, Text, Title } from "@homarr/ui";
|
||||
|
||||
import { LogoWithTitle } from "~/components/layout/logo";
|
||||
import { LoginForm } from "./_components/login-form";
|
||||
|
||||
Reference in New Issue
Block a user