]> cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/features/ui/components/column_header.js
Merge pull request #223 from glitch-soc/glitchsoc/feature/configurable-status-size
[mastodon.git] / app / javascript / mastodon / features / ui / components / column_header.js
1 import React from 'react';
2 import PropTypes from 'prop-types';
3
4 export default class ColumnHeader extends React.PureComponent {
5
6 static propTypes = {
7 icon: PropTypes.string,
8 type: PropTypes.string,
9 active: PropTypes.bool,
10 onClick: PropTypes.func,
11 columnHeaderId: PropTypes.string,
12 };
13
14 handleClick = () => {
15 this.props.onClick();
16 }
17
18 render () {
19 const { type, active, columnHeaderId } = this.props;
20
21 let icon = '';
22
23 if (this.props.icon) {
24 icon = <i className={`fa fa-fw fa-${this.props.icon} column-header__icon`} />;
25 }
26
27 return (
28 <div role='heading' tabIndex='0' className={`column-header ${active ? 'active' : ''}`} onClick={this.handleClick} id={columnHeaderId || null}>
29 {icon}
30 {type}
31 </div>
32 );
33 }
34
35 }
This page took 0.076408 seconds and 4 git commands to generate.