Sha256: 1c7af7cd8e717f441e78927e81e1e6f6ab853a6d6a618058e773872d7002a013

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

/* @flow */
/*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */

import React from 'react'
import classnames from 'classnames'

import {
  Person,
  Contact,
} from '../'

type PersonContactProps = {
  className?: String | Array<String>,
  dark?: Boolean,
  people?: Array<{firstName: String, lastName: String}>,
  contacts?: Array<{contactType: String, contactValue: String}>,
}

const contactsArray = ({contacts=[]}: PersonContactProps) => {
  return contacts.map((contactObject, index) => {
    return (
      <Contact
        contactType={contactObject.contactType}
        contactValue={contactObject.contactValue}
      />
    );
  })
}

const peopleArray = ({people=[]}: PersonContactProps) => {
  return people.map((personObject, index) => {
    return (
      <Person
        firstName={personObject.firstName}
        lastName={personObject.lastName}
      />
    );
  })
}

const PersonContact = ({
  className,
  dark=false,
  people,
  contacts,
}: PersonContactProps) => {

  const contactKits = contactsArray({contacts})
  const personKits = peopleArray({people})

  return (
    <div className={classnames('pb_person_contact_kit', className)}>
      {personKits}
      {contactKits}
    </div>
  )
}

export default PersonContact

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
playbook_ui-2.9.6 app/pb_kits/playbook/pb_person_contact/_person_contact.jsx
playbook_ui-2.9.5 app/pb_kits/playbook/pb_person_contact/_person_contact.jsx
playbook_ui-2.9.4 app/pb_kits/playbook/pb_person_contact/_person_contact.jsx