Merge branch 'develop' into groups-updates

* develop:
  Updated status component to use properStatus when going to status page
  Added floating action button to ui/index
  Removed floating action button from columns area
  Fix issue with notification badge number not showing on mobile
  Updated scrollable_list to use documentElement for (primary/only) scrolling functionality
  Added onScroll props to status_list
  Added timeline scrollTop action, added to status_list_container, scrollable_list
  Removed unnecessary scrollContainer in status, account_gallery
  Added missing isLoading prop to ScrollableList
  Updated scrollable_list intersectionObserverWrapper
  Updated floatingActionButton to only show if someone is logged in
  Updated timeline_queue_button_header
  Removed focus of compose/cw after submit or spoiler change
  Removed set height of 100% on body
  Removed unused redirect after compose submit
  Patch Fix for hidden poll choices and results on light theme.
  Updated notification badge number formatter
  Fixed status/repost functionality to show status if owned by given username
  admin tool for editing pro status of accounts
This commit is contained in:
2458773093
2019-07-18 23:02:16 +03:00
27 changed files with 297 additions and 156 deletions

View File

@@ -1,6 +1,6 @@
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';
@@ -15,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'>
@@ -64,8 +51,6 @@ class ColumnsArea extends ImmutablePureComponent {
{layout.RIGHT}
</div>
</div>
{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);

View File

@@ -5,6 +5,7 @@ import { createSelector } from 'reselect';
import { debounce } from 'lodash';
import { me } from '../../../initial_state';
import { dequeueTimeline } from 'gabsocial/actions/timelines';
import { scrollTopTimeline } from '../../../actions/timelines';
const makeGetStatusIds = () => createSelector([
(state, { type }) => state.getIn(['settings', type], ImmutableMap()),
@@ -45,6 +46,12 @@ const mapDispatchToProps = (dispatch, ownProps) => ({
onDequeueTimeline(timelineId) {
dispatch(dequeueTimeline(timelineId, ownProps.onLoadMore));
},
onScrollToTop: debounce(() => {
dispatch(scrollTopTimeline(ownProps.timelineId, true));
}, 100),
onScroll: debounce(() => {
dispatch(scrollTopTimeline(ownProps.timelineId, false));
}, 100),
});
export default connect(mapStateToProps, mapDispatchToProps)(StatusList);

View File

@@ -70,6 +70,7 @@ import '../../components/status';
const messages = defineMessages({
beforeUnload: { id: 'ui.beforeunload', defaultMessage: 'Your draft will be lost if you leave Gab Social.' },
publish: { id: 'compose_form.publish', defaultMessage: 'Gab' },
});
const mapStateToProps = state => ({
@@ -132,6 +133,8 @@ const LAYOUT = {
},
};
const shouldHideFAB = path => path.match(/^\/posts\/|^\/search|^\/getting-started/);
class SwitchingColumnsArea extends React.PureComponent {
static propTypes = {
@@ -487,9 +490,13 @@ class UI extends React.PureComponent {
this.context.router.history.push('/follow_requests');
}
handleOpenComposeModal = () => {
this.props.dispatch(openModal("COMPOSE"));
}
render () {
const { draggingOver } = this.state;
const { children, isComposing, location, dropdownMenuIsOpen } = this.props;
const { intl, children, isComposing, location, dropdownMenuIsOpen } = this.props;
const handlers = me ? {
help: this.handleHotkeyToggleHelp,
@@ -509,6 +516,8 @@ class UI extends React.PureComponent {
goToRequests: this.handleHotkeyGoToRequests,
} : {};
const floatingActionButton = shouldHideFAB(this.context.router.history.location.pathname) ? null : <button key='floating-action-button' onClick={this.handleOpenComposeModal} className='floating-action-button' aria-label={intl.formatMessage(messages.publish)}></button>;
return (
<HotKeys keyMap={keyMap} handlers={handlers} ref={this.setHotkeysRef} attach={window} focused>
<div className={classNames('ui', { 'is-composing': isComposing })} ref={this.setRef} style={{ pointerEvents: dropdownMenuIsOpen ? 'none' : null }}>
@@ -517,6 +526,8 @@ class UI extends React.PureComponent {
{children}
</SwitchingColumnsArea>
{me && floatingActionButton}
<NotificationsContainer />
<LoadingBarContainer className='loading-bar' />
<ModalContainer />