bigbuffet-rw/app/soapbox/components/column.js

35 lines
710 B
JavaScript
Raw Normal View History

2020-03-27 13:59:38 -07:00
import React from 'react';
import PropTypes from 'prop-types';
2021-10-05 20:01:16 -07:00
import classNames from 'classnames';
2020-03-27 13:59:38 -07:00
export default class Column extends React.PureComponent {
static propTypes = {
2021-10-05 20:01:16 -07:00
className: PropTypes.string,
transparent: PropTypes.bool,
2020-03-27 13:59:38 -07:00
children: PropTypes.node,
label: PropTypes.string,
};
setRef = c => {
this.node = c;
}
render() {
const { className, label, children, transparent, ...rest } = this.props;
2020-03-27 13:59:38 -07:00
return (
2021-10-05 20:01:16 -07:00
<div
role='region'
aria-label={label}
className={classNames('column', className, { 'column--transparent': transparent })}
{...rest}
ref={this.setRef}
2021-10-05 20:01:16 -07:00
>
2020-03-27 13:59:38 -07:00
{children}
</div>
);
}
}