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,46 @@
import { getActiveClasses } from 'get-active-classes'
const InputText = ({
value,
isEditable,
onChange,
className,
isInvalid = false,
}) => {
return (
<>
<div
className={getActiveClasses(
'relative inline-block',
{ hidden: !isEditable },
className
)}
>
<div
className={getActiveClasses(
'absolute inset-0 mb-2 rounded bg-gray-200 shadow-inner',
{ 'border border-red-500': isInvalid }
)}
/>
<input
className="pl-2 pt-1 text-indigo-800 font-medium mb-px pb-px bg-transparent relative"
onChange={onChange}
value={value}
readOnly={!onChange}
type="text"
/>
</div>
<span
className={getActiveClasses(
'pl-2 text-indigo-800 font-medium mb-px pb-px',
{ hidden: isEditable },
className
)}
>
{value}
</span>
</>
)
}
export default InputText

View File

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

View File

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