From 5bc36508d21409e7e7d99ee5c4c045311369e931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Messiant?= Date: Fri, 15 Mar 2019 17:28:39 +0100 Subject: [PATCH] feat: Use cozy-ui fields (input and textarea) --- .../ContactCard/ContactFieldInput.jsx | 5 +- .../__snapshots__/index.spec.jsx.snap | 84 ++++++++++++------- .../Form/__snapshots__/fields.spec.jsx.snap | 35 ++++++++ src/components/Form/fields.jsx | 27 ++++++ src/components/Form/fields.spec.jsx | 43 ++++++++++ 5 files changed, 164 insertions(+), 30 deletions(-) create mode 100644 src/components/Form/__snapshots__/fields.spec.jsx.snap create mode 100644 src/components/Form/fields.jsx create mode 100644 src/components/Form/fields.spec.jsx diff --git a/src/components/ContactCard/ContactFieldInput.jsx b/src/components/ContactCard/ContactFieldInput.jsx index 195fd5f65..31d4c6b69 100644 --- a/src/components/ContactCard/ContactFieldInput.jsx +++ b/src/components/ContactCard/ContactFieldInput.jsx @@ -4,9 +4,10 @@ import { Field } from 'react-final-form' import classnames from 'classnames' import HasValueCondition from '../Form/HasValueCondition' +import { AdaptedInput, AdaptedTextarea } from '../Form/fields' const getInputComponent = inputType => - inputType === 'textarea' ? 'textarea' : 'input' + inputType === 'textarea' ? AdaptedTextarea : AdaptedInput class ContactFieldInput extends React.Component { state = { @@ -65,7 +66,7 @@ class ContactFieldInput extends React.Component {