Skip to content

Commit

Permalink
feat(ArticleCard): refactor props
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonjoseph committed May 16, 2019
1 parent c5d302a commit 81861fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/example/src/pages/components/ArticleCard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>

Expand All @@ -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"
>
Expand All @@ -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
>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -61,7 +61,7 @@ export default class ArticleCard extends React.Component {
};

static defaultProps = {
dark: false,
color: 'light',
disabled: false,
actionIcon: '',
};
Expand All @@ -74,7 +74,7 @@ export default class ArticleCard extends React.Component {
author,
date,
readTime,
dark,
color,
disabled,
actionIcon,
className,
Expand All @@ -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(
Expand Down

0 comments on commit 81861fa

Please sign in to comment.