This is just a technology testing project based on Create React App and TailwindCSS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 1.4KB

4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
1234567891011121314151617181920212223242526272829303132333435
  1. import React from 'react'
  2. import FormikControlString from './FormikControlTypes/FormikControlString'
  3. import FormikControlText from './FormikControlTypes/FormikControlText';
  4. import FormikControlPassword from './FormikControlTypes/FormikControlPassword'
  5. import FormikControlCheckbox from './FormikControlTypes/FormikControlCheckbox'
  6. import FormikControlCheckboxGroup from './FormikControlTypes/FormikControlCheckboxGroup';
  7. import FormikControlRadioGroup from './FormikControlTypes/FormikControlRadioGroup';
  8. import FormikControlUserConsent from './FormikControlTypes/FormikControlUserConsent'
  9. export function FormikControl(props) {
  10. const { control, ...rest } = props
  11. switch (control) {
  12. case 'string':
  13. return <FormikControlString {...rest} />
  14. case 'password':
  15. return <FormikControlPassword {...rest} />
  16. case 'text':
  17. return <FormikControlText {...rest} />
  18. // case 'select':
  19. // return <FormikControlSelect {...rest} />
  20. case 'radio-group':
  21. return <FormikControlRadioGroup {...rest} />
  22. case 'checkbox':
  23. return <FormikControlCheckbox {...rest} />
  24. case 'checkbox-group':
  25. return <FormikControlCheckboxGroup {...rest} />
  26. case 'userconsent':
  27. return <FormikControlUserConsent {...rest} />
  28. default:
  29. return null
  30. }
  31. }
  32. export default FormikControl