upgrade redwood to v 0.36

This commit is contained in:
Kurt Hutten
2021-08-31 20:12:18 +10:00
parent f5113da9c2
commit 01a28f4d53
12 changed files with 3052 additions and 3531 deletions

View File

@@ -0,0 +1,34 @@
import { getActiveClasses } from 'get-active-classes'
import { TextField, FieldError } from '@redwoodjs/forms'
import { useFormContext } from 'react-hook-form'
const InputText = ({ type = 'text', className, name, validation }) => {
const { formState: { errors } } = useFormContext()
return (
<>
<div className={getActiveClasses('relative inline-block', className)}>
<FieldError
className="absolute -my-4 text-sm text-red-500 font-ropa-sans"
name={name}
/>
<div
className={getActiveClasses(
'absolute inset-0 mb-2 rounded bg-gray-200 shadow-inner',
{ 'border border-red-500': errors[name] }
)}
/>
<TextField
className={getActiveClasses(
'pl-2 pt-1 text-indigo-800 font-medium mb-px pb-px bg-transparent relative w-full'
)}
name={name}
readOnly={false}
type={type}
validation={validation}
/>
</div>
</>
)
}
export default InputText