add bando page form;
This commit is contained in:
32
src/components/FormField/index.js
Normal file
32
src/components/FormField/index.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import React from 'react';
|
||||
import { isNil } from 'ramda';
|
||||
import { classNames } from 'primereact/utils';
|
||||
|
||||
// components
|
||||
import TextInput from './components/TextInput';
|
||||
import TextArea from './components/TextArea';
|
||||
import Datepicker from './components/Datepicker';
|
||||
import DatepickerRange from './components/DatepickerRange';
|
||||
import Fileupload from './components/Fileupload';
|
||||
import NumberInput from './components/NumberInput';
|
||||
|
||||
const FormField = (props) => {
|
||||
const fields = {
|
||||
textinput: TextInput,
|
||||
textarea: TextArea,
|
||||
datepicker: Datepicker,
|
||||
datepickerrange: DatepickerRange,
|
||||
fileupload: Fileupload,
|
||||
numberinput: NumberInput
|
||||
}
|
||||
const Comp = !isNil(fields[props.type]) ? fields[props.type] : null;
|
||||
|
||||
return (!isNil(Comp)
|
||||
? <div className={classNames(['appForm__field', props.type])}>
|
||||
<Comp {...props} />
|
||||
</div>
|
||||
: null
|
||||
)
|
||||
}
|
||||
|
||||
export default FormField;
|
||||
Reference in New Issue
Block a user