From fa22b8ed229f93de1236a74d4df4a0b5fa57dddd Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 3 May 2022 11:38:17 +0200 Subject: [PATCH] Move DM conversation/timeline tab to column settings switch --- .../components/column_settings.js | 7 +++++ .../glitch/features/direct_timeline/index.js | 31 +------------------ 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.js b/app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.js index ce14e2a9db8..18c3c7e21e8 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.js +++ b/app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.js @@ -2,6 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; +import SettingToggle from 'flavours/glitch/features/notifications/components/setting_toggle'; import SettingText from '../../../components/setting_text'; const messages = defineMessages({ @@ -23,6 +24,12 @@ class ColumnSettings extends React.PureComponent { return (
+ + +
+ } /> +
+
diff --git a/app/javascript/flavours/glitch/features/direct_timeline/index.js b/app/javascript/flavours/glitch/features/direct_timeline/index.js index 870d2069ea0..75ca19d1703 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/index.js +++ b/app/javascript/flavours/glitch/features/direct_timeline/index.js @@ -10,7 +10,6 @@ import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/col import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ColumnSettingsContainer from './containers/column_settings_container'; import { connectDirectStream } from 'flavours/glitch/actions/streaming'; -import { changeSetting } from 'flavours/glitch/actions/settings'; import ConversationsListContainer from './containers/conversations_list_container'; const messages = defineMessages({ @@ -99,14 +98,6 @@ class DirectTimeline extends React.PureComponent { this.props.dispatch(expandConversations({ maxId })); } - handleTimelineClick = () => { - this.props.dispatch(changeSetting(['direct', 'conversations'], false)); - } - - handleConversationsClick = () => { - this.props.dispatch(changeSetting(['direct', 'conversations'], true)); - } - render () { const { intl, hasUnread, columnId, multiColumn, conversationsMode } = this.props; const pinned = !!columnId; @@ -130,6 +121,7 @@ class DirectTimeline extends React.PureComponent { scrollKey={`direct_timeline-${columnId}`} timelineId='direct' onLoadMore={this.handleLoadMoreTimeline} + prepend={
} emptyMessage={} /> ); @@ -150,27 +142,6 @@ class DirectTimeline extends React.PureComponent { -
- - -
- {contents} );