woocommerce/plugins/woocommerce-admin/client/components/activity-card
Kelly Dwan 99ac7728cd Try a context-aware heading component (https://github.com/woocommerce/woocommerce-admin/pull/121)
* Add H and Section components for context-aware headings

* Switch to using the new context-aware heading and section components

* Style header by class name, not heading level

* Add our client dir to the modules list for Jest

We already have this setting in webpack, but Jest doesn’t pick up on that
2018-06-20 11:10:06 -04:00
..
README.md Add ActivityCard component (https://github.com/woocommerce/woocommerce-admin/pull/86) 2018-05-25 15:34:35 -04:00
index.js Try a context-aware heading component (https://github.com/woocommerce/woocommerce-admin/pull/121) 2018-06-20 11:10:06 -04:00
style.scss Add CSS naming conventions following Gutenberg’s standards (https://github.com/woocommerce/woocommerce-admin/pull/99) 2018-06-01 10:35:18 -04:00

README.md

ActivityCard

A card designed for use in the timeline/sidebar. This is a very structured component, which expects at minimum a label and content. It can optionally also include a date, actions, an image, and a dropdown menu.

How to use:

import ActivityCard from 'components/activity-card';

render: function() {
  return (
    <ActivityCard
      label="Insight"
      icon={ <Dashicon icon="search" /> }
      date="30 minutes ago"
      actions={ [ <a href="/">Action link</a>, <a href="/">Action link 2</a> ] }
      image={ <Dashicon icon="palmtree" /> }
    >
      Insight content goes in this area here. It will probably be a couple of lines long and may
      include an accompanying image. We might consider color-coding the icon for quicker
      scanning.
    </ActivityCard>
  );
}

Props

  • label: A title for this card (required).
  • children: Content used in the body of the action card (required).
  • actions: A list of links or buttons shown in the footer of the card.
  • date: The timestamp associated with this activity.
  • icon: An icon used to label this activity. Defaults to "warning".
  • image: An image show in this card. Can be img or Dashicon (or any renderable element).
  • menu: A dropdown menu (EllipsisMenu) shown at the top-right of the card.