|
|
@ -2,6 +2,7 @@
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React from 'react';
|
|
|
|
import React from 'react';
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
|
|
|
|
|
|
|
// Actions.
|
|
|
|
// Actions.
|
|
|
|
import { openModal } from 'flavours/glitch/actions/modal';
|
|
|
|
import { openModal } from 'flavours/glitch/actions/modal';
|
|
|
@ -11,6 +12,7 @@ import {
|
|
|
|
showSearch,
|
|
|
|
showSearch,
|
|
|
|
submitSearch,
|
|
|
|
submitSearch,
|
|
|
|
} from 'flavours/glitch/actions/search';
|
|
|
|
} from 'flavours/glitch/actions/search';
|
|
|
|
|
|
|
|
import { cycleElefriendCompose } from 'flavours/glitch/actions/compose';
|
|
|
|
|
|
|
|
|
|
|
|
// Components.
|
|
|
|
// Components.
|
|
|
|
import Composer from 'flavours/glitch/features/composer';
|
|
|
|
import Composer from 'flavours/glitch/features/composer';
|
|
|
@ -27,6 +29,7 @@ import { wrap } from 'flavours/glitch/util/redux_helpers';
|
|
|
|
const mapStateToProps = state => ({
|
|
|
|
const mapStateToProps = state => ({
|
|
|
|
account: state.getIn(['accounts', me]),
|
|
|
|
account: state.getIn(['accounts', me]),
|
|
|
|
columns: state.getIn(['settings', 'columns']),
|
|
|
|
columns: state.getIn(['settings', 'columns']),
|
|
|
|
|
|
|
|
elefriend: state.getIn(['compose', 'elefriend']),
|
|
|
|
results: state.getIn(['search', 'results']),
|
|
|
|
results: state.getIn(['search', 'results']),
|
|
|
|
searchHidden: state.getIn(['search', 'hidden']),
|
|
|
|
searchHidden: state.getIn(['search', 'hidden']),
|
|
|
|
searchValue: state.getIn(['search', 'value']),
|
|
|
|
searchValue: state.getIn(['search', 'value']),
|
|
|
@ -37,6 +40,7 @@ const mapStateToProps = state => ({
|
|
|
|
const mapDispatchToProps = {
|
|
|
|
const mapDispatchToProps = {
|
|
|
|
onChange: changeSearch,
|
|
|
|
onChange: changeSearch,
|
|
|
|
onClear: clearSearch,
|
|
|
|
onClear: clearSearch,
|
|
|
|
|
|
|
|
onClickElefriend: cycleElefriendCompose,
|
|
|
|
onShow: showSearch,
|
|
|
|
onShow: showSearch,
|
|
|
|
onSubmit: submitSearch,
|
|
|
|
onSubmit: submitSearch,
|
|
|
|
onOpenSettings: openModal.bind(null, 'SETTINGS', {}),
|
|
|
|
onOpenSettings: openModal.bind(null, 'SETTINGS', {}),
|
|
|
@ -55,10 +59,12 @@ class Drawer extends React.Component {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
account,
|
|
|
|
account,
|
|
|
|
columns,
|
|
|
|
columns,
|
|
|
|
|
|
|
|
elefriend,
|
|
|
|
intl,
|
|
|
|
intl,
|
|
|
|
multiColumn,
|
|
|
|
multiColumn,
|
|
|
|
onChange,
|
|
|
|
onChange,
|
|
|
|
onClear,
|
|
|
|
onClear,
|
|
|
|
|
|
|
|
onClickElefriend,
|
|
|
|
onOpenSettings,
|
|
|
|
onOpenSettings,
|
|
|
|
onShow,
|
|
|
|
onShow,
|
|
|
|
onSubmit,
|
|
|
|
onSubmit,
|
|
|
@ -68,6 +74,10 @@ class Drawer extends React.Component {
|
|
|
|
submitted,
|
|
|
|
submitted,
|
|
|
|
} = this.props;
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let innerDrawerAttrs = {
|
|
|
|
|
|
|
|
className: classNames('drawer--inner', 'mbstobon-' + elefriend),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// The result.
|
|
|
|
// The result.
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className='drawer'>
|
|
|
|
<div className='drawer'>
|
|
|
@ -89,7 +99,10 @@ class Drawer extends React.Component {
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<div className='contents'>
|
|
|
|
<div className='contents'>
|
|
|
|
<DrawerAccount account={account} />
|
|
|
|
<DrawerAccount account={account} />
|
|
|
|
|
|
|
|
<div {...innerDrawerAttrs}>
|
|
|
|
<Composer />
|
|
|
|
<Composer />
|
|
|
|
|
|
|
|
{multiColumn && <button className='mastodon' onClick={onClickElefriend} />}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<DrawerResults
|
|
|
|
<DrawerResults
|
|
|
|
results={results}
|
|
|
|
results={results}
|
|
|
|
visible={submitted && !searchHidden}
|
|
|
|
visible={submitted && !searchHidden}
|
|
|
@ -110,6 +123,7 @@ Drawer.propTypes = {
|
|
|
|
account: ImmutablePropTypes.map,
|
|
|
|
account: ImmutablePropTypes.map,
|
|
|
|
columns: ImmutablePropTypes.list,
|
|
|
|
columns: ImmutablePropTypes.list,
|
|
|
|
results: ImmutablePropTypes.map,
|
|
|
|
results: ImmutablePropTypes.map,
|
|
|
|
|
|
|
|
elefriend: PropTypes.number,
|
|
|
|
searchHidden: PropTypes.bool,
|
|
|
|
searchHidden: PropTypes.bool,
|
|
|
|
searchValue: PropTypes.string,
|
|
|
|
searchValue: PropTypes.string,
|
|
|
|
submitted: PropTypes.bool,
|
|
|
|
submitted: PropTypes.bool,
|
|
|
@ -117,6 +131,7 @@ Drawer.propTypes = {
|
|
|
|
// Dispatch props.
|
|
|
|
// Dispatch props.
|
|
|
|
onChange: PropTypes.func,
|
|
|
|
onChange: PropTypes.func,
|
|
|
|
onClear: PropTypes.func,
|
|
|
|
onClear: PropTypes.func,
|
|
|
|
|
|
|
|
onClickElefriend: PropTypes.func,
|
|
|
|
onShow: PropTypes.func,
|
|
|
|
onShow: PropTypes.func,
|
|
|
|
onSubmit: PropTypes.func,
|
|
|
|
onSubmit: PropTypes.func,
|
|
|
|
onOpenSettings: PropTypes.func,
|
|
|
|
onOpenSettings: PropTypes.func,
|
|
|
|