about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features
diff options
context:
space:
mode:
authorbeatrix <beatrix.bitrot@gmail.com>2018-01-14 17:40:27 -0500
committerGitHub <noreply@github.com>2018-01-14 17:40:27 -0500
commit39f231f3da1ffe7e8a75df924790005fde5fe7fa (patch)
tree678d0d3290116ad446561b8c7d9578a0e19d9868 /app/javascript/flavours/glitch/features
parent0fb3bd09e9acaa72e4fac89768408015d33d8c3e (diff)
parentc2669f93d0f885245a2d272485cd58092b96546b (diff)
Merge pull request #328 from glitch-soc/feature/glitchy-elephant-friend
Add glitchy elephant friend
Diffstat (limited to 'app/javascript/flavours/glitch/features')
-rw-r--r--app/javascript/flavours/glitch/features/drawer/index.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js
index 9ade1f87a..375954cb6 100644
--- a/app/javascript/flavours/glitch/features/drawer/index.js
+++ b/app/javascript/flavours/glitch/features/drawer/index.js
@@ -2,6 +2,7 @@
 import PropTypes from 'prop-types';
 import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
+import classNames from 'classnames';
 
 //  Actions.
 import { openModal } from 'flavours/glitch/actions/modal';
@@ -11,6 +12,7 @@ import {
   showSearch,
   submitSearch,
 } from 'flavours/glitch/actions/search';
+import { cycleElefriendCompose } from 'flavours/glitch/actions/compose';
 
 //  Components.
 import Composer from 'flavours/glitch/features/composer';
@@ -27,6 +29,7 @@ import { wrap } from 'flavours/glitch/util/redux_helpers';
 const mapStateToProps = state => ({
   account: state.getIn(['accounts', me]),
   columns: state.getIn(['settings', 'columns']),
+  elefriend: state.getIn(['compose', 'elefriend']),
   results: state.getIn(['search', 'results']),
   searchHidden: state.getIn(['search', 'hidden']),
   searchValue: state.getIn(['search', 'value']),
@@ -37,6 +40,7 @@ const mapStateToProps = state => ({
 const mapDispatchToProps = {
   onChange: changeSearch,
   onClear: clearSearch,
+  onClickElefriend: cycleElefriendCompose,
   onShow: showSearch,
   onSubmit: submitSearch,
   onOpenSettings: openModal.bind(null, 'SETTINGS', {}),
@@ -55,10 +59,12 @@ class Drawer extends React.Component {
     const {
       account,
       columns,
+      elefriend,
       intl,
       multiColumn,
       onChange,
       onClear,
+      onClickElefriend,
       onOpenSettings,
       onShow,
       onSubmit,
@@ -68,6 +74,10 @@ class Drawer extends React.Component {
       submitted,
     } = this.props;
 
+    let innerDrawerAttrs = {
+      className: classNames('drawer--inner', 'mbstobon-' + elefriend),
+    };
+
     //  The result.
     return (
       <div className='drawer'>
@@ -89,7 +99,10 @@ class Drawer extends React.Component {
         />
         <div className='contents'>
           <DrawerAccount account={account} />
-          <Composer />
+          <div {...innerDrawerAttrs}>
+            <Composer />
+            {multiColumn && <button className='mastodon' onClick={onClickElefriend} />}
+          </div>
           <DrawerResults
             results={results}
             visible={submitted && !searchHidden}
@@ -110,6 +123,7 @@ Drawer.propTypes = {
   account: ImmutablePropTypes.map,
   columns: ImmutablePropTypes.list,
   results: ImmutablePropTypes.map,
+  elefriend: PropTypes.number,
   searchHidden: PropTypes.bool,
   searchValue: PropTypes.string,
   submitted: PropTypes.bool,
@@ -117,6 +131,7 @@ Drawer.propTypes = {
   //  Dispatch props.
   onChange: PropTypes.func,
   onClear: PropTypes.func,
+  onClickElefriend: PropTypes.func,
   onShow: PropTypes.func,
   onSubmit: PropTypes.func,
   onOpenSettings: PropTypes.func,