diff options
author | beatrix <beatrix.bitrot@gmail.com> | 2018-04-26 11:34:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-26 11:34:14 -0400 |
commit | f4ed38272be7cce814e3d3e7e5a2d1f352279e19 (patch) | |
tree | 4e26499478b18d2338be90f21428f1bd76481b89 /app/javascript/flavours/glitch/features/ui | |
parent | 8f12afb5996c58ddf41ceaa20f6c4e036273d3a6 (diff) | |
parent | b383c0688a0939d25b9184e61dac72cda71f6926 (diff) |
Merge pull request #401 from ThibG/glitch-soc/features/unfold-thread
Port the “unfold thread” feature from Mastodon's UI to glitch-soc flavour
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui')
-rw-r--r-- | app/javascript/flavours/glitch/features/ui/components/column_header.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/column_header.js b/app/javascript/flavours/glitch/features/ui/components/column_header.js index af195ea9c..e8bdd8054 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column_header.js +++ b/app/javascript/flavours/glitch/features/ui/components/column_header.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import classNames from 'classnames'; export default class ColumnHeader extends React.PureComponent { @@ -16,19 +17,20 @@ export default class ColumnHeader extends React.PureComponent { } render () { - const { type, active, columnHeaderId } = this.props; + const { icon, type, active, columnHeaderId } = this.props; + let iconElement = ''; - let icon = ''; - - if (this.props.icon) { - icon = <i className={`fa fa-fw fa-${this.props.icon} column-header__icon`} />; + if (icon) { + iconElement = <i className={`fa fa-fw fa-${icon} column-header__icon`} />; } return ( - <div role='heading' tabIndex='0' className={`column-header ${active ? 'active' : ''}`} onClick={this.handleClick} id={columnHeaderId || null}> - {icon} - {type} - </div> + <h1 className={classNames('column-header', { active })} id={columnHeaderId || null}> + <button onClick={this.handleClick}> + {iconElement} + {type} + </button> + </h1> ); } |