From ade2c5ebb3c0b81c691157a7be8600366d01f2ff Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 15 Oct 2021 18:55:04 -0500 Subject: [PATCH] Notifications: add back column settings --- .../components/column_settings.js | 193 ++++++++++-------- app/soapbox/features/notifications/index.js | 8 +- app/styles/components/columns.scss | 4 + 3 files changed, 113 insertions(+), 92 deletions(-) diff --git a/app/soapbox/features/notifications/components/column_settings.js b/app/soapbox/features/notifications/components/column_settings.js index 8e2c837f9..aa55f5296 100644 --- a/app/soapbox/features/notifications/components/column_settings.js +++ b/app/soapbox/features/notifications/components/column_settings.js @@ -1,18 +1,26 @@ import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import { FormattedMessage } from 'react-intl'; +import { injectIntl, defineMessages, FormattedMessage } from 'react-intl'; import ClearColumnButton from './clear_column_button'; import SettingToggle from './setting_toggle'; import MultiSettingToggle from './multi_setting_toggle'; +import IconButton from 'soapbox/components/icon_button'; -export default class ColumnSettings extends React.PureComponent { +const messages = defineMessages({ + close: { id: 'lightbox.close', defaultMessage: 'Close' }, +}); + +export default @injectIntl +class ColumnSettings extends React.PureComponent { static propTypes = { + intl: PropTypes.object.isRequired, settings: ImmutablePropTypes.map.isRequired, pushSettings: ImmutablePropTypes.map.isRequired, onChange: PropTypes.func.isRequired, onClear: PropTypes.func.isRequired, + onClose: PropTypes.func.isRequired, supportsEmojiReacts: PropTypes.bool, }; @@ -29,7 +37,7 @@ export default class ColumnSettings extends React.PureComponent { } render() { - const { settings, pushSettings, onChange, onClear, supportsEmojiReacts } = this.props; + const { intl, settings, pushSettings, onChange, onClear, onClose, supportsEmojiReacts } = this.props; const filterShowStr = ; const filterAdvancedStr = ; @@ -42,113 +50,124 @@ export default class ColumnSettings extends React.PureComponent { const pushStr = showPushSettings && ; return ( -
-
- -
- -
- - - - -
- -
- - - -
- - +
+
+

+ +

+
+
-
- - +
- - {showPushSettings && } - - +
-
-
- - -
- - {showPushSettings && } - - +
+ + + +
-
-
- - -
- - {showPushSettings && } - - +
+ + + +
+ + +
-
- {supportsEmojiReacts &&
- +
+ -
- - {showPushSettings && } - - +
+ + {showPushSettings && } + + +
-
} -
- +
+ -
- - {showPushSettings && } - - +
+ + {showPushSettings && } + + +
-
-
- +
+ -
- - {showPushSettings && } - - +
+ + {showPushSettings && } + + +
-
-
- + {supportsEmojiReacts &&
+ -
- - {showPushSettings && } - - +
+ + {showPushSettings && } + + +
+
} + +
+ + +
+ + {showPushSettings && } + + +
-
-
- +
+ -
- - {showPushSettings && } - - +
+ + {showPushSettings && } + + +
+
+ +
+ + +
+ + {showPushSettings && } + + +
+
+ +
+ + +
+ + {showPushSettings && } + + +
diff --git a/app/soapbox/features/notifications/index.js b/app/soapbox/features/notifications/index.js index 8e4982ce0..79f879deb 100644 --- a/app/soapbox/features/notifications/index.js +++ b/app/soapbox/features/notifications/index.js @@ -3,7 +3,6 @@ import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import Column from '../../components/column'; -import ColumnHeader from '../../components/column_header'; import { expandNotifications, scrollTopNotifications, @@ -21,6 +20,7 @@ import LoadGap from '../../components/load_gap'; import TimelineQueueButtonHeader from '../../components/timeline_queue_button_header'; import { getSettings } from 'soapbox/actions/settings'; import PlaceholderNotification from 'soapbox/features/placeholder/components/placeholder_notification'; +import SubNavigation from 'soapbox/components/sub_navigation'; const messages = defineMessages({ title: { id: 'column.notifications', defaultMessage: 'Notifications' }, @@ -129,7 +129,7 @@ class Notifications extends React.PureComponent { }; render() { - const { intl, notifications, isLoading, isUnread, hasMore, showFilterBar, totalQueuedNotificationsCount } = this.props; + const { intl, notifications, isLoading, hasMore, showFilterBar, totalQueuedNotificationsCount } = this.props; const emptyMessage = ; let scrollableContent = null; @@ -183,9 +183,7 @@ class Notifications extends React.PureComponent { return ( - - - + {filterBarContainer}