diff --git a/react/ContactPicker/Readme.md b/react/ContactPicker/Readme.md index 67b2e5ed62..7a577b6344 100644 --- a/react/ContactPicker/Readme.md +++ b/react/ContactPicker/Readme.md @@ -6,6 +6,7 @@ initialState = { selectedContact: null }; setState({ selectedContact })} value={state.selectedContact} /> diff --git a/react/ContactPicker/index.jsx b/react/ContactPicker/index.jsx index fbf8bb1c1c..e52f30ce3e 100644 --- a/react/ContactPicker/index.jsx +++ b/react/ContactPicker/index.jsx @@ -19,7 +19,7 @@ const SelectControl = props => { } const ContactPicker = props => { - const { placeholder, onChange, value, ...rest } = props + const { placeholder, listPlaceholder, onChange, value, ...rest } = props const [showContactsList, setShowContactsList] = useState(false) const handleChange = contact => { @@ -35,6 +35,7 @@ const ContactPicker = props => { setShowContactsList(false)} onItemClick={handleChange} + placeholder={listPlaceholder} /> )} diff --git a/react/ContactsListModal/index.jsx b/react/ContactsListModal/index.jsx index 45b04789e9..c0b41fcf3b 100644 --- a/react/ContactsListModal/index.jsx +++ b/react/ContactsListModal/index.jsx @@ -1,12 +1,13 @@ import React, { useState } from 'react' import { Query, fetchPolicies } from 'cozy-client' import ContactsList from '../ContactsList' -import Modal, { ModalHeader, ModalDescription, ModalBackButton } from '../Modal' +import Modal, { ModalHeader, ModalDescription } from '../Modal' import Spinner from '../Spinner' import styles from './styles.styl' import Input from '../Input' import PropTypes from 'prop-types' import withBreakpoints from '../helpers/withBreakpoints' +import Button from '../Button' import { Contact } from 'cozy-doctypes' const thirtySeconds = 30000 @@ -60,9 +61,12 @@ const ContactsListModal = props => { {isMobile && ( - )} { - - {values.map((value, index) => { - return ( -
- -
- ) - })} -
+ {values.length > 0 ? ( + + {values.map((value, index) => { + return ( +
+ +
+ ) + })} +
+ ) : null}