chore: switch to react-router v7

This commit is contained in:
Aarnav Tale 2024-12-31 10:30:14 +05:30
parent 39504e2487
commit aa9872a45b
No known key found for this signature in database
101 changed files with 3825 additions and 6796 deletions

View file

@ -1,38 +1,30 @@
import { type Dispatch, type SetStateAction } from 'react'
import {
Input,
TextField as AriaTextField
} from 'react-aria-components'
import { Dispatch, SetStateAction } from 'react';
import { Input, TextField as AriaTextField } from 'react-aria-components';
import { cn } from '~/utils/cn';
import { cn } from '~/utils/cn'
type TextFieldProperties = Parameters<typeof AriaTextField>[0] & {
type TextFieldProps = Parameters<typeof AriaTextField>[0] & {
readonly label: string;
readonly placeholder: string;
readonly state?: [string, Dispatch<SetStateAction<string>>];
}
};
export default function TextField(properties: TextFieldProperties) {
export default function TextField(props: TextFieldProps) {
return (
<AriaTextField
{...properties}
aria-label={properties.label}
className='w-full'
>
<AriaTextField {...props} aria-label={props.label} className="w-full">
<Input
placeholder={properties.placeholder}
value={properties.state?.[0]}
name={properties.name}
placeholder={props.placeholder}
value={props.state?.[0]}
name={props.name}
className={cn(
'block px-2.5 py-1.5 w-full rounded-lg my-1',
'border border-ui-200 dark:border-ui-600',
'dark:bg-ui-800 dark:text-ui-300',
properties.className
props.className,
)}
onChange={event => {
properties.state?.[1](event.target.value)
onChange={(event) => {
props.state?.[1](event.target.value);
}}
/>
</AriaTextField>
)
);
}