-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate prop type from Card component in favor to use Card.XXX comp…
…onents
- Loading branch information
John Benavides
committed
Dec 27, 2017
1 parent
d6dcc93
commit 56e6432
Showing
13 changed files
with
337 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classnames from 'classnames'; | ||
|
||
export default class CardContent extends React.PureComponent { | ||
static displayName = 'Card.Content' | ||
|
||
static propTypes = { | ||
className: PropTypes.string, | ||
renderAs: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), | ||
} | ||
|
||
static defaultProps = { | ||
className: '', | ||
renderAs: 'div', | ||
} | ||
|
||
render() { | ||
const { | ||
className, | ||
renderAs, | ||
...props | ||
} = this.props; | ||
const Element = renderAs; | ||
return ( | ||
<Element {...props} className={classnames('card-content', className)} /> | ||
); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/components/card/components/footer/components/footer-item.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classnames from 'classnames'; | ||
|
||
export default class CardFooterItem extends React.PureComponent { | ||
static displayName = 'Card.Footer.Item' | ||
|
||
static propTypes = { | ||
className: PropTypes.string, | ||
renderAs: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), | ||
} | ||
|
||
static defaultProps = { | ||
className: '', | ||
renderAs: 'div', | ||
} | ||
|
||
render() { | ||
const { | ||
className, | ||
renderAs, | ||
...props | ||
} = this.props; | ||
const Element = renderAs; | ||
return ( | ||
<Element {...props} className={classnames('card-footer-item', className)} /> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classnames from 'classnames'; | ||
import CardFooterItem from './components/footer-item'; | ||
|
||
export default class CardFooter extends React.PureComponent { | ||
static displayName = 'Card.Footer' | ||
|
||
static propTypes = { | ||
className: PropTypes.string, | ||
renderAs: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), | ||
} | ||
|
||
static defaultProps = { | ||
className: '', | ||
renderAs: 'div', | ||
} | ||
|
||
static Item = CardFooterItem | ||
|
||
render() { | ||
const { | ||
className, | ||
renderAs, | ||
...props | ||
} = this.props; | ||
const Element = renderAs; | ||
return ( | ||
<Element {...props} className={classnames('card-footer', className)} /> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './footer'; |
29 changes: 29 additions & 0 deletions
29
src/components/card/components/header/components/header-icon.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classnames from 'classnames'; | ||
|
||
export default class CardHeaderIcon extends React.PureComponent { | ||
static displayName = 'Card.Header.Icon' | ||
|
||
static propTypes = { | ||
className: PropTypes.string, | ||
renderAs: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), | ||
} | ||
|
||
static defaultProps = { | ||
className: '', | ||
renderAs: 'div', | ||
} | ||
|
||
render() { | ||
const { | ||
className, | ||
renderAs, | ||
...props | ||
} = this.props; | ||
const Element = renderAs; | ||
return ( | ||
<Element {...props} className={classnames('card-header-icon', className)} /> | ||
); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/components/card/components/header/components/header-title.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classnames from 'classnames'; | ||
|
||
export default class CardHeaderTitle extends React.PureComponent { | ||
static displayName = 'Card.Header.Title' | ||
|
||
static propTypes = { | ||
className: PropTypes.string, | ||
renderAs: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), | ||
} | ||
|
||
static defaultProps = { | ||
className: '', | ||
renderAs: 'div', | ||
} | ||
|
||
render() { | ||
const { | ||
className, | ||
renderAs, | ||
...props | ||
} = this.props; | ||
const Element = renderAs; | ||
return ( | ||
<Element {...props} className={classnames('card-header-title', className)} /> | ||
); | ||
} | ||
} |
Oops, something went wrong.