How to use the cozy-doctypes.Contact.getDisplayName function in cozy-doctypes

To help you get started, we’ve selected a few cozy-doctypes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cozy / cozy-ui / react / ContactPicker / index.jsx View on Github external
const ContactPicker = props => {
  const { placeholder, onChange, value, ...rest } = props
  const [showContactsList, setShowContactsList] = useState(false)

  const handleChange = contact => {
    onChange(contact)
  }

  return (
    <>
       setShowContactsList(true)}>
        {value ? Contact.getDisplayName(value) : placeholder}
      
      {showContactsList && (
         setShowContactsList(false)}
          onItemClick={handleChange}
        />
      )}
    
  )
}
github cozy / cozy-ui / react / ContactsListModal / index.jsx View on Github external
return contacts.filter(contact => {
    const displayName = Contact.getDisplayName(contact)

    if (!displayName) {
      return false
    }

    return displayName.toLowerCase().includes(f)
  })
}