on master help sign in
updated kelvin and fixing error message
e595f1dHunter Miller
desk/sys.kelvin+1−1
@@ -1 +1 @@
1−[%zuse 418]
1+[%zuse 417]
ui/src/components/ErrorMessage.tsx+3−3
@@ -1,16 +1,16 @@
1import cn from 'classnames';
1import cn from 'classnames';
2import React from 'react';
2import React from 'react';
3−import { LiteralUnion, RegisterOptions, useFormContext } from 'react-hook-form';
3+import { FieldValues, LiteralUnion, RegisterOptions, useFormContext } from 'react-hook-form';
4
4
5type Validation = LiteralUnion<keyof RegisterOptions, string>;
5type Validation = LiteralUnion<keyof RegisterOptions, string>;
6
6
7−interface ErrorMessageProps<T> {
7+interface ErrorMessageProps<T extends FieldValues> {
8 field: keyof T;
8 field: keyof T;
9 messages: Partial<Record<Validation, string>>;
9 messages: Partial<Record<Validation, string>>;
10 className?: string;
10 className?: string;
11}
11}
12
12
13−export function ErrorMessage<T>({ field, messages, className }: ErrorMessageProps<T>) {
13+export function ErrorMessage<T extends FieldValues>({ field, messages, className }: ErrorMessageProps<T>) {
14 const { formState } = useFormContext<T>();
14 const { formState } = useFormContext<T>();
15 const error = formState.errors[field];
15 const error = formState.errors[field];
16
16
ui/tailwind.config.js+1
@@ -1,3 +1,4 @@
1+/** @type {import('tailwindcss').Config} */
1module.exports = {
2module.exports = {
2 content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
3 content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
3 theme: {
4 theme: {
ui/tsconfig.json+1−1
@@ -2,7 +2,7 @@
2 "compilerOptions": {
2 "compilerOptions": {
3 "target": "ESNext",
3 "target": "ESNext",
4 "lib": ["DOM", "DOM.Iterable", "ESNext"],
4 "lib": ["DOM", "DOM.Iterable", "ESNext"],
5− "allowJs": false,
5+ "allowJs": true,
6 "skipLibCheck": false,
6 "skipLibCheck": false,
7 "esModuleInterop": false,
7 "esModuleInterop": false,
8 "allowSyntheticDefaultImports": true,
8 "allowSyntheticDefaultImports": true,