From 81861fa2e056dba8cf4e051ac8140e3d3f5197a8 Mon Sep 17 00:00:00 2001 From: Alison Joseph Date: Thu, 16 May 2019 14:20:23 -0500 Subject: [PATCH] feat(ArticleCard): refactor props --- packages/example/src/pages/components/ArticleCard.mdx | 6 +++--- .../src/components/ArticleCard/ArticleCard.js | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/example/src/pages/components/ArticleCard.mdx b/packages/example/src/pages/components/ArticleCard.mdx index 6b4c951f3..093b1f2ff 100644 --- a/packages/example/src/pages/components/ArticleCard.mdx +++ b/packages/example/src/pages/components/ArticleCard.mdx @@ -51,7 +51,7 @@ import { Row, Column, ArticleCard, PageDescription } from 'gatsby-theme-carbon'; author="Josh Black" date="April 29, 2019" readTime="Read time: 5 min" - dark + color="dark" href="https://www.ibm.com" > @@ -65,7 +65,7 @@ import { Row, Column, ArticleCard, PageDescription } from 'gatsby-theme-carbon'; author="Josh Black" date="April 29, 2019" readTime="Read time: 5 min" - dark + color="dark" href="https://www.ibm.com" actionIcon="arrowRight" > @@ -80,7 +80,7 @@ import { Row, Column, ArticleCard, PageDescription } from 'gatsby-theme-carbon'; author="Josh Black" date="April 29, 2019" readTime="Read time: 5 min" - dark + color="dark" disabled > diff --git a/packages/gatsby-theme-carbon/src/components/ArticleCard/ArticleCard.js b/packages/gatsby-theme-carbon/src/components/ArticleCard/ArticleCard.js index f6f702575..99fa252e7 100755 --- a/packages/gatsby-theme-carbon/src/components/ArticleCard/ArticleCard.js +++ b/packages/gatsby-theme-carbon/src/components/ArticleCard/ArticleCard.js @@ -45,9 +45,9 @@ export default class ArticleCard extends React.Component { actionIcon: PropTypes.string, /** - * Use for dark card + * set to "dark" for dark background card */ - dark: PropTypes.bool, + color: PropTypes.string, /** * Use for disabled card @@ -61,7 +61,7 @@ export default class ArticleCard extends React.Component { }; static defaultProps = { - dark: false, + color: 'light', disabled: false, actionIcon: '', }; @@ -74,7 +74,7 @@ export default class ArticleCard extends React.Component { author, date, readTime, - dark, + color, disabled, actionIcon, className, @@ -88,7 +88,7 @@ export default class ArticleCard extends React.Component { const ArticleCardClassNames = classnames([`${prefix}--article-card`], { [className]: className, [`${prefix}--article-card--disabled`]: disabled, - [`${prefix}--article-card--dark`]: dark, + [`${prefix}--article-card--dark`]: color === 'dark', }); const aspectRatioClassNames = classnames(