Removed floating action button from columns area

This commit is contained in:
mgabdev 2019-07-18 00:17:36 -04:00
parent 42e9d5a360
commit b163726651
2 changed files with 3 additions and 27 deletions

View File

@ -1,13 +1,12 @@
import React from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import { injectIntl } from 'react-intl';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ReactSwipeableViews from 'react-swipeable-views';
import { links, getIndex, getLink } from './tabs_bar';
import { Link } from 'react-router-dom';
import { me } from 'gabsocial/initial_state';
import BundleContainer from '../containers/bundle_container';
import ColumnLoading from './column_loading';
@ -16,33 +15,20 @@ import BundleColumnError from './bundle_column_error';
import { Compose, Notifications, HomeTimeline, CommunityTimeline, HashtagTimeline, DirectTimeline, FavouritedStatuses, ListTimeline } from '../../ui/util/async-components';
import Icon from 'gabsocial/components/icon';
const messages = defineMessages({
publish: { id: 'compose_form.publish', defaultMessage: 'Gab' },
});
const shouldHideFAB = path => path.match(/^\/statuses\/|^\/search|^\/getting-started/);
export default @(component => injectIntl(component, { withRef: true }))
class ColumnsArea extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object.isRequired,
};
static propTypes = {
intl: PropTypes.object.isRequired,
columns: ImmutablePropTypes.list.isRequired,
isModalOpen: PropTypes.bool.isRequired,
children: PropTypes.node,
layout: PropTypes.object,
};
render () {
const { columns, children, isModalOpen, intl, onOpenCompose } = this.props;
const { columns, children, intl } = this.props;
const layout = this.props.layout || {LEFT:null,RIGHT:null};
const floatingActionButton = shouldHideFAB(this.context.router.history.location.pathname) ? null : <button key='floating-action-button' onClick={onOpenCompose} className='floating-action-button' aria-label={intl.formatMessage(messages.publish)}></button>;
return (
<div className='page'>
<div className='page__columns'>
@ -65,7 +51,6 @@ class ColumnsArea extends ImmutablePureComponent {
{layout.RIGHT}
</div>
</div>
{me && floatingActionButton}
</div>
</div>

View File

@ -1,17 +1,8 @@
import { connect } from 'react-redux';
import ColumnsArea from '../components/columns_area';
import { openModal } from '../../../actions/modal';
const mapStateToProps = state => ({
columns: state.getIn(['settings', 'columns']),
isModalOpen: !!state.get('modal').modalType,
});
const mapDispatchToProps = (dispatch) => ({
onOpenCompose() {
dispatch(openModal('COMPOSE'));
},
});
export default connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true })(ColumnsArea);
export default connect(mapStateToProps, null, null, { forwardRef: true })(ColumnsArea);