woocommerce/plugins/woocommerce-admin/client/layout/activity-panel/activity-card
Kelly Dwan dec97d178e Components: Export reusable components to a separate file + global (https://github.com/woocommerce/woocommerce-admin/pull/297)
* Importing all components from a root components file

* Update Ratings component to avoid circular dependencies, fix tests

* Export components on `wc.components`, use this for importing

* Move react-dates initialize to the components file

* Push query changes to history

Fixes an issues where native a links do not update the query in `history`

* Update test config for new @woocommerce/components path

* Update chart components import

* Merge simple/complex & alphabetize by first exported name

* Add a readme with info about how to call these components
2018-08-20 17:18:13 -04:00
..
test Components: Export reusable components to a separate file + global (https://github.com/woocommerce/woocommerce-admin/pull/297) 2018-08-20 17:18:13 -04:00
README.md Activity Panel: Add loading placeholder for ActivityCard, using Inbox as demo (https://github.com/woocommerce/woocommerce-admin/pull/220) 2018-07-20 14:41:39 -04:00
index.js Add Collapsed Review View (https://github.com/woocommerce/woocommerce-admin/pull/242) 2018-08-01 08:21:51 -04:00
placeholder.js Activity Panel: Add loading placeholder for ActivityCard, using Inbox as demo (https://github.com/woocommerce/woocommerce-admin/pull/220) 2018-07-20 14:41:39 -04:00
style.scss Add Collapsed Review View (https://github.com/woocommerce/woocommerce-admin/pull/242) 2018-08-01 08:21:51 -04:00

README.md

ActivityCard

A card designed for use in the activity panel. 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
      title="Insight"
      icon={ <Gridicon icon="search" /> }
      date="2018-07-10T00:00:00Z"
      actions={ [ <a href="/">Action link</a>, <a href="/">Action link 2</a> ] }
    >
      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

  • title: A title for this card (required).
  • subtitle: An element rendered right under the title.
  • 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 or avatar used to identify this activity. Defaults to Gridicon "notice-outline".
  • unread: If this prop is present, the card has a small red bubble indicating an "unread" item. Defaults to false.

ActivityCardPlaceholder

This component is similar to ActivityCard in output, but renders no real content, just loading placeholders. This is also hidden from any interaction with screen readers using aria-hidden.

How to use:

import { ActivityCardPlaceholder } from 'components/activity-card';

render: function() {
  return (
    <ActivityCardPlaceholder hasDate />
  );
}

Props

  • hasAction: Boolean. If true, shows a placeholder block for an action. Default false.
  • hasDate: Boolean. If true, shows a placeholder block for the date. Default false.
  • hasSubtitle: Boolean. If true, shows a placeholder block for the subtitle. Default false.
  • lines: Number. How many lines of placeholder content we should show. Default 1.