Attempt to at move app into app sub dir

This commit is contained in:
Kurt Hutten
2021-05-01 07:32:21 +10:00
parent 9db76458d1
commit 78677a99f8
220 changed files with 1 additions and 1 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 { 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

View File

@@ -0,0 +1,7 @@
import InputTextForm from './InputTextForm'
export const generated = () => {
return <InputTextForm />
}
export default { title: 'Components/InputTextForm' }

View File

@@ -0,0 +1,11 @@
import { render } from '@redwoodjs/testing'
import InputTextForm from './InputTextForm'
describe('InputTextForm', () => {
it('renders successfully', () => {
expect(() => {
render(<InputTextForm />)
}).not.toThrow()
})
})