changed media settings to new form

This commit is contained in:
dswbx
2025-02-05 11:04:37 +01:00
parent f432473ed9
commit 4b3493a6f5
18 changed files with 110 additions and 1031 deletions

View File

@@ -6,9 +6,18 @@ import { transform } from "lodash-es";
import type { ComponentPropsWithoutRef } from "react";
import { Button } from "ui/components/buttons/Button";
import { Group, Input, Label } from "ui/components/form/Formy/components";
import { TypeboxValidator } from "ui/components/form/json-schema-form";
import { SocialLink } from "./SocialLink";
import type { ValueError } from "@sinclair/typebox/value";
import { type TSchema, Value } from "core/utils";
import type { Validator } from "json-schema-form-react";
class TypeboxValidator implements Validator<ValueError> {
async validate(schema: TSchema, data: any) {
return Value.Check(schema, data) ? [] : [...Value.Errors(schema, data)];
}
}
export type LoginFormProps = Omit<ComponentPropsWithoutRef<"form">, "onSubmit" | "action"> & {
className?: string;
formData?: any;
@@ -75,7 +84,7 @@ export function AuthForm({
<Form
method={method}
action={password.action}
{...props}
{...(props as any)}
schema={schema}
validator={validator}
validationMode="change"