about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/ui/components
diff options
context:
space:
mode:
authorbeatrix <beatrix.bitrot@gmail.com>2018-04-26 11:34:14 -0400
committerGitHub <noreply@github.com>2018-04-26 11:34:14 -0400
commitf4ed38272be7cce814e3d3e7e5a2d1f352279e19 (patch)
tree4e26499478b18d2338be90f21428f1bd76481b89 /app/javascript/flavours/glitch/features/ui/components
parent8f12afb5996c58ddf41ceaa20f6c4e036273d3a6 (diff)
parentb383c0688a0939d25b9184e61dac72cda71f6926 (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/components')
-rw-r--r--app/javascript/flavours/glitch/features/ui/components/column_header.js20
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>
     );
   }