Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

fix(Columns): Allow Columns to accept a className prop #595

Merged
merged 1 commit into from
Jan 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions react/Columns/Columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,26 @@ import PropTypes from 'prop-types';
import classnames from 'classnames';

const renderColumn = (el, index) => (
<div key={index} className={styles.column}>{el}</div>
<div key={index} className={styles.column}>
{el}
</div>
);

export default function Columns({ children, tight, flexible, reverse }) {
export default function Columns({
children,
tight,
flexible,
reverse,
className
}) {
return (
<div
className={classnames({
[styles.columns]: true,
[styles.columns_tight]: tight,
[styles.columns_flexible]: flexible,
[styles.columns_reverse]: reverse
[styles.columns_reverse]: reverse,
[className]: className
})}>
{children.map(renderColumn)}
</div>
Expand All @@ -26,7 +35,8 @@ Columns.propTypes = {
children: PropTypes.array.isRequired,
tight: PropTypes.bool,
flexible: PropTypes.bool,
reverse: PropTypes.bool
reverse: PropTypes.bool,
className: PropTypes.string
};

Columns.defaultProps = {
Expand Down