From a1512316d870aa2362fece35d24d3add6005f60a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 5 Oct 2021 17:07:00 -0500 Subject: [PATCH] Add Mastodon compatibility routes, expose /conversations, display Messages tab for Mastodon --- app/soapbox/components/primary_navigation.js | 89 +++++++++++++------- app/soapbox/components/thumb_navigation.js | 34 +++++--- app/soapbox/features/ui/index.js | 9 ++ app/styles/components/icon.scss | 9 ++ 4 files changed, 98 insertions(+), 43 deletions(-) diff --git a/app/soapbox/components/primary_navigation.js b/app/soapbox/components/primary_navigation.js index 8aed7a09d..eb7efbe3c 100644 --- a/app/soapbox/components/primary_navigation.js +++ b/app/soapbox/components/primary_navigation.js @@ -26,7 +26,7 @@ const mapStateToProps = state => { chatsCount: state.get('chats').reduce((acc, curr) => acc + Math.min(curr.get('unread', 0), 1), 0), dashboardCount: reportsCount + approvalCount, features: getFeatures(instance), - siteTitle: state.getIn(['instance', 'title']), + instance, }; }; @@ -45,12 +45,12 @@ class PrimaryNavigation extends React.PureComponent { notificationCount: PropTypes.number, chatsCount: PropTypes.number, features: PropTypes.object.isRequired, - siteTitle: PropTypes.string, location: PropTypes.object, + instance: ImmutablePropTypes.map.isRequired, }; render() { - const { account, features, notificationCount, chatsCount, dashboardCount, siteTitle, location } = this.props; + const { account, features, notificationCount, chatsCount, dashboardCount, location, instance } = this.props; return (
@@ -60,14 +60,37 @@ class PrimaryNavigation extends React.PureComponent { - {account && - 0 ? require('@tabler/icons/icons/bell-ringing-2.svg') : require('@tabler/icons/icons/bell.svg')} - className={classNames('primary-navigation__icon', { 'svg-icon--active': location.pathname === '/notifications' })} - count={notificationCount} - /> - - } + {account && ( + + 0 ? require('@tabler/icons/icons/bell-ringing-2.svg') : require('@tabler/icons/icons/bell.svg')} + className={classNames('primary-navigation__icon', { 'svg-icon--active': location.pathname === '/notifications' })} + count={notificationCount} + /> + + + )} + + {account && ( + features.chats ? ( + + + + + ) : ( + + + + + ) + )} - {(features.chats && account) && - - - } + {(account && isStaff(account)) && ( + + + + + )} - {(account && isStaff(account)) && - - - } + {(account && instance.get('invites_enabled')) && ( + + + + + )}
@@ -103,7 +126,7 @@ class PrimaryNavigation extends React.PureComponent { src={require('@tabler/icons/icons/users.svg')} className={classNames('primary-navigation__icon', { 'svg-icon--active': location.pathname === '/timeline/local' })} /> - {siteTitle} + {instance.get('title')} ) : ( @@ -112,10 +135,12 @@ class PrimaryNavigation extends React.PureComponent { )} - {features.federating && - - - } + {features.federating && ( + + + + + )}
); diff --git a/app/soapbox/components/thumb_navigation.js b/app/soapbox/components/thumb_navigation.js index 9ffd4c0fb..64ba0206a 100644 --- a/app/soapbox/components/thumb_navigation.js +++ b/app/soapbox/components/thumb_navigation.js @@ -66,17 +66,29 @@ class ThumbNavigation extends React.PureComponent { )} - {(features.chats && account) && ( - - - - - - + {account && ( + features.chats ? ( + + + + + + + ) : ( + + + + + + + ) )} diff --git a/app/soapbox/features/ui/index.js b/app/soapbox/features/ui/index.js index 77f7bf2a3..15aaf930f 100644 --- a/app/soapbox/features/ui/index.js +++ b/app/soapbox/features/ui/index.js @@ -58,6 +58,7 @@ import { Reactions, // Favourites, DirectTimeline, + Conversations, HashtagTimeline, Notifications, FollowRequests, @@ -219,6 +220,7 @@ class SwitchingColumnsArea extends React.PureComponent { + {/* @@ -236,14 +238,20 @@ class SwitchingColumnsArea extends React.PureComponent { + + + + + + {/* Soapbox Legacy redirects */} @@ -286,6 +294,7 @@ class SwitchingColumnsArea extends React.PureComponent { + diff --git a/app/styles/components/icon.scss b/app/styles/components/icon.scss index 118d39420..ebfed91c4 100644 --- a/app/styles/components/icon.scss +++ b/app/styles/components/icon.scss @@ -29,6 +29,15 @@ fill: var(--primary-text-color); } } + + svg.icon-tabler-mail { + stroke: var(--background-color); + + rect { + fill: var(--primary-text-color); + stroke: var(--primary-text-color); + } + } } }