Attempt to at move app into app sub dir
This commit is contained in:
33
app/web/src/components/ProfileTextInput/ProfileTextInput.js
Normal file
33
app/web/src/components/ProfileTextInput/ProfileTextInput.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Fragment } from 'react'
|
||||
|
||||
import InputText from 'src/components/InputText'
|
||||
|
||||
const ProfileTextInput = ({ fields, isEditable, onChange = () => {} }) => {
|
||||
return (
|
||||
<div>
|
||||
<div
|
||||
className="grid items-center"
|
||||
style={{ gridTemplateColumns: 'auto 1fr' }}
|
||||
>
|
||||
{Object.entries(fields).map(([property, value]) => (
|
||||
<Fragment key={property}>
|
||||
<span className="capitalize text-gray-500 text-sm align-middle my-3">
|
||||
{property}:
|
||||
</span>
|
||||
|
||||
<InputText
|
||||
className="text-xl"
|
||||
value={value}
|
||||
onChange={({ target }) =>
|
||||
onChange({ ...fields, [property]: target.value })
|
||||
}
|
||||
isEditable={isEditable}
|
||||
/>
|
||||
</Fragment>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ProfileTextInput
|
||||
@@ -0,0 +1,7 @@
|
||||
import ProfileTextInput from './ProfileTextInput'
|
||||
|
||||
export const generated = () => {
|
||||
return <ProfileTextInput />
|
||||
}
|
||||
|
||||
export default { title: 'Components/ProfileTextInput' }
|
||||
@@ -0,0 +1,11 @@
|
||||
import { render } from '@redwoodjs/testing'
|
||||
|
||||
import ProfileTextInput from './ProfileTextInput'
|
||||
|
||||
describe('ProfileTextInput', () => {
|
||||
it('renders successfully', () => {
|
||||
expect(() => {
|
||||
render(<ProfileTextInput />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user