From a93729cc7759a05e46186c81ef1c783be2a44aae Mon Sep 17 00:00:00 2001 From: Ezinwa Okpoechi Date: Tue, 21 Feb 2017 18:47:48 +0100 Subject: [PATCH] feat(Card): add link prop (#1359) * feat(Card): add link prop * docs(Card): add example for card link prop * fix(CardExampleLinkCardProp): description prop --- .../Card/Content/CardExampleLinkCardProp.js | 16 ++++++++++++++++ docs/app/Examples/views/Card/Content/index.js | 3 +++ src/views/Card/Card.js | 5 +++++ test/specs/views/Card/Card-test.js | 1 + 4 files changed, 25 insertions(+) create mode 100644 docs/app/Examples/views/Card/Content/CardExampleLinkCardProp.js diff --git a/docs/app/Examples/views/Card/Content/CardExampleLinkCardProp.js b/docs/app/Examples/views/Card/Content/CardExampleLinkCardProp.js new file mode 100644 index 0000000000..ad8c13628a --- /dev/null +++ b/docs/app/Examples/views/Card/Content/CardExampleLinkCardProp.js @@ -0,0 +1,16 @@ +import React from 'react' +import { Card } from 'semantic-ui-react' + +const CardExampleLinkCardProp = () => ( + +) + +export default CardExampleLinkCardProp diff --git a/docs/app/Examples/views/Card/Content/index.js b/docs/app/Examples/views/Card/Content/index.js index 98d8e86e93..2599e0e903 100644 --- a/docs/app/Examples/views/Card/Content/index.js +++ b/docs/app/Examples/views/Card/Content/index.js @@ -30,6 +30,9 @@ const Content = () => ( description='A card can be formatted to link to other content.' examplePath='views/Card/Content/CardExampleLinkCard' /> + ) diff --git a/src/views/Card/Card.js b/src/views/Card/Card.js index 9621e8dd95..f3d4a225df 100644 --- a/src/views/Card/Card.js +++ b/src/views/Card/Card.js @@ -55,6 +55,9 @@ export default class Card extends Component { /** A card can contain an Image component. */ image: customPropTypes.itemShorthand, + /** A card can be formatted to link to other content. */ + link: PropTypes.bool, + /** Shorthand for CardMeta. */ meta: customPropTypes.itemShorthand, @@ -100,6 +103,7 @@ export default class Card extends Component { header, href, image, + link, meta, onClick, raised, @@ -110,6 +114,7 @@ export default class Card extends Component { color, useKeyOnly(centered, 'centered'), useKeyOnly(fluid, 'fluid'), + useKeyOnly(link, 'link'), useKeyOnly(raised, 'raised'), 'card', className, diff --git a/test/specs/views/Card/Card-test.js b/test/specs/views/Card/Card-test.js index fa3037afb9..9c23229261 100644 --- a/test/specs/views/Card/Card-test.js +++ b/test/specs/views/Card/Card-test.js @@ -19,6 +19,7 @@ describe('Card', () => { common.propKeyOnlyToClassName(Card, 'centered') common.propKeyOnlyToClassName(Card, 'fluid') + common.propKeyOnlyToClassName(Card, 'link') common.propKeyOnlyToClassName(Card, 'raised') common.propValueOnlyToClassName(Card, 'color', SUI.COLORS)