Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 981 Bytes

Readme.md

File metadata and controls

43 lines (35 loc) · 981 Bytes

Raw list

import ContactsList from 'cozy-ui/transpiled/react/ContactsList'
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
import contacts from './_mockContacts.json'

;

<BreakpointsProvider>
  <div style={{ height: 500, overflowY: 'scroll' }}>
    <ContactsList contacts={contacts} />
  </div>
</BreakpointsProvider>

Clickable items

import ContactsList from 'cozy-ui/transpiled/react/ContactsList'
import contacts from './_mockContacts.json'
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'

initialState = { contact: null }

;

<BreakpointsProvider>
  <p>
    {state.contact ? (
        `Clicked on contact ${state.contact._id}`
      ) : (
        'No contact clicked'
    )}
  </p>
  <div style={{ height: 500, overflowY: 'scroll' }}>
    <ContactsList
      contacts={contacts}
      onItemClick={contact => setState({ contact })}
    />
  </div>
</BreakpointsProvider>