From e08a297effccd5c17fc7c1a3517fbcd6e5602960 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 30 Apr 2022 11:28:18 -0500 Subject: [PATCH 1/6] /auth/verify --> /verify --- app/soapbox/containers/soapbox.tsx | 4 ++-- app/soapbox/features/auth_layout/index.tsx | 5 ++--- app/soapbox/features/landing_page/index.tsx | 2 +- app/soapbox/features/public_layout/components/header.tsx | 2 +- .../features/ui/components/modals/landing-page-modal.js | 2 +- app/soapbox/features/verification/__tests__/index.test.tsx | 4 ++-- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/soapbox/containers/soapbox.tsx b/app/soapbox/containers/soapbox.tsx index 44b661cf9..bd3af006d 100644 --- a/app/soapbox/containers/soapbox.tsx +++ b/app/soapbox/containers/soapbox.tsx @@ -157,7 +157,7 @@ const SoapboxMount = () => { <> - + {waitlisted && } />} @@ -170,7 +170,7 @@ const SoapboxMount = () => { - + diff --git a/app/soapbox/features/auth_layout/index.tsx b/app/soapbox/features/auth_layout/index.tsx index 6f7f51b95..c8b2c1bb9 100644 --- a/app/soapbox/features/auth_layout/index.tsx +++ b/app/soapbox/features/auth_layout/index.tsx @@ -42,12 +42,11 @@ const AuthLayout = () => { - - + + - {/* */} diff --git a/app/soapbox/features/landing_page/index.tsx b/app/soapbox/features/landing_page/index.tsx index 307cda35a..a33b9e871 100644 --- a/app/soapbox/features/landing_page/index.tsx +++ b/app/soapbox/features/landing_page/index.tsx @@ -49,7 +49,7 @@ const LandingPage = () => { Social Media Without Discrimination - + ); }; diff --git a/app/soapbox/features/public_layout/components/header.tsx b/app/soapbox/features/public_layout/components/header.tsx index c10eaea4e..70f2fcf46 100644 --- a/app/soapbox/features/public_layout/components/header.tsx +++ b/app/soapbox/features/public_layout/components/header.tsx @@ -96,7 +96,7 @@ const Header = () => { {(isOpen || features.pepe && pepeOpen) && ( {isOpen && ( - )} diff --git a/app/soapbox/features/verification/__tests__/index.test.tsx b/app/soapbox/features/verification/__tests__/index.test.tsx index 27a88957e..2eda52852 100644 --- a/app/soapbox/features/verification/__tests__/index.test.tsx +++ b/app/soapbox/features/verification/__tests__/index.test.tsx @@ -9,7 +9,7 @@ import Verification from '../index'; const TestableComponent = () => ( - + Homepage ); @@ -18,7 +18,7 @@ const renderComponent = (store) => render( , {}, store, - { initialEntries: ['/auth/verify'] }, + { initialEntries: ['/verify'] }, ); describe('', () => { From f19bd32e52496df68906e52d74716fbeb9a83d67 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 30 Apr 2022 11:31:04 -0500 Subject: [PATCH 2/6] /admin --> /soapbox/admin --- app/soapbox/components/sidebar-navigation.tsx | 2 +- app/soapbox/components/thumb_navigation.tsx | 2 +- app/soapbox/features/admin/components/admin-tabs.tsx | 12 ++++++------ .../admin/components/latest_accounts_panel.tsx | 2 +- app/soapbox/features/admin/index.tsx | 6 +++--- app/soapbox/features/admin/tabs/dashboard.tsx | 2 +- app/soapbox/features/ui/index.tsx | 12 ++++++------ 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/soapbox/components/sidebar-navigation.tsx b/app/soapbox/components/sidebar-navigation.tsx index 9809d99c1..16b305b33 100644 --- a/app/soapbox/components/sidebar-navigation.tsx +++ b/app/soapbox/components/sidebar-navigation.tsx @@ -73,7 +73,7 @@ const SidebarNavigation = () => { if (account.staff) { menu.push({ - to: '/admin', + to: '/soapbox/admin', icon: require('@tabler/icons/icons/dashboard.svg'), text: , count: dashboardCount, diff --git a/app/soapbox/components/thumb_navigation.tsx b/app/soapbox/components/thumb_navigation.tsx index d9953fb05..21de09300 100644 --- a/app/soapbox/components/thumb_navigation.tsx +++ b/app/soapbox/components/thumb_navigation.tsx @@ -61,7 +61,7 @@ const ThumbNavigation: React.FC = (): JSX.Element => { } - to='/admin' + to='/soapbox/admin' count={dashboardCount} /> )} diff --git a/app/soapbox/features/admin/components/admin-tabs.tsx b/app/soapbox/features/admin/components/admin-tabs.tsx index 4602cd0aa..debba46a0 100644 --- a/app/soapbox/features/admin/components/admin-tabs.tsx +++ b/app/soapbox/features/admin/components/admin-tabs.tsx @@ -19,18 +19,18 @@ const AdminTabs: React.FC = () => { const reportsCount = useAppSelector(state => state.admin.openReports.count()); const tabs = [{ - name: '/admin', + name: '/soapbox/admin', text: intl.formatMessage(messages.dashboard), - to: '/admin', + to: '/soapbox/admin', }, { - name: '/admin/reports', + name: '/soapbox/admin/reports', text: intl.formatMessage(messages.reports), - to: '/admin/reports', + to: '/soapbox/admin/reports', count: reportsCount, }, { - name: '/admin/approval', + name: '/soapbox/admin/approval', text: intl.formatMessage(messages.waitlist), - to: '/admin/approval', + to: '/soapbox/admin/approval', count: approvalCount, }]; diff --git a/app/soapbox/features/admin/components/latest_accounts_panel.tsx b/app/soapbox/features/admin/components/latest_accounts_panel.tsx index 26b383713..62636c366 100644 --- a/app/soapbox/features/admin/components/latest_accounts_panel.tsx +++ b/app/soapbox/features/admin/components/latest_accounts_panel.tsx @@ -46,7 +46,7 @@ const LatestAccountsPanel: React.FC = ({ limit = 5 }) => { } const handleAction = () => { - history.push('/admin/users'); + history.push('/soapbox/admin/users'); }; return ( diff --git a/app/soapbox/features/admin/index.tsx b/app/soapbox/features/admin/index.tsx index dae7fc2e7..84f72eda8 100644 --- a/app/soapbox/features/admin/index.tsx +++ b/app/soapbox/features/admin/index.tsx @@ -26,9 +26,9 @@ const Admin: React.FC = () => { - - - + + + ); diff --git a/app/soapbox/features/admin/tabs/dashboard.tsx b/app/soapbox/features/admin/tabs/dashboard.tsx index 248885b21..86810d3c5 100644 --- a/app/soapbox/features/admin/tabs/dashboard.tsx +++ b/app/soapbox/features/admin/tabs/dashboard.tsx @@ -77,7 +77,7 @@ const Dashboard: React.FC = () => { )} {isNumber(userCount) && ( - + diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index 99fe59b12..e144c9b01 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -227,7 +227,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => { {/* Mastodon rendered pages */} - + @@ -302,11 +302,11 @@ const SwitchingColumnsArea: React.FC = ({ children }) => { {/* */} - - - - - + + + + + From 28ead43f967cee8a48ef1264622714f2b201810e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 30 Apr 2022 11:45:58 -0500 Subject: [PATCH 3/6] Fix DMs link --- app/soapbox/components/sidebar-navigation.tsx | 43 ++++++++++------- app/soapbox/components/thumb_navigation.tsx | 47 ++++++++++++------- app/soapbox/features/conversations/index.js | 47 +++++++------------ app/soapbox/features/ui/index.tsx | 8 +++- 4 files changed, 79 insertions(+), 66 deletions(-) diff --git a/app/soapbox/components/sidebar-navigation.tsx b/app/soapbox/components/sidebar-navigation.tsx index 16b305b33..3ce3b9e28 100644 --- a/app/soapbox/components/sidebar-navigation.tsx +++ b/app/soapbox/components/sidebar-navigation.tsx @@ -106,6 +106,32 @@ const SidebarNavigation = () => { const menu = makeMenu(); + /** Conditionally render the supported messages link */ + const renderMessagesLink = (): React.ReactNode => { + if (features.chats) { + return ( + } + /> + ); + } + + if (features.directTimeline || features.conversations) { + return ( + } + /> + ); + } + + return null; + }; + return (
@@ -138,22 +164,7 @@ const SidebarNavigation = () => { )} - {account && ( - features.chats ? ( - } - /> - ) : ( - } - /> - ) - )} + {account && renderMessagesLink()} {menu.length > 0 && ( diff --git a/app/soapbox/components/thumb_navigation.tsx b/app/soapbox/components/thumb_navigation.tsx index 21de09300..c1ac80fae 100644 --- a/app/soapbox/components/thumb_navigation.tsx +++ b/app/soapbox/components/thumb_navigation.tsx @@ -12,6 +12,34 @@ const ThumbNavigation: React.FC = (): JSX.Element => { const dashboardCount = useAppSelector((state) => state.admin.openReports.count() + state.admin.awaitingApproval.count()); const features = getFeatures(useAppSelector((state) => state.instance)); + /** Conditionally render the supported messages link */ + const renderMessagesLink = (): React.ReactNode => { + if (features.chats) { + return ( + } + to='/chats' + exact + count={chatsCount} + /> + ); + } + + if (features.directTimeline || features.conversations) { + return ( + } + to='/messages' + paths={['/messages', '/conversations']} + /> + ); + } + + return null; + }; + return (
{ /> )} - {account && ( - features.chats ? ( - } - to='/chats' - exact - count={chatsCount} - /> - ) : ( - } - to='/messages' - paths={['/messages', '/conversations']} - /> - ) - )} + {account && renderMessagesLink()} {(account && account.staff) && ( - - - - {intl.formatMessage(messages.title)} - {intl.formatMessage(messages.body)} - - - + + + + } + /> ); - - // return ( - // - // - - // - - // } - // /> - // - // ); } } diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index e144c9b01..3b9255ec0 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -187,8 +187,12 @@ const SwitchingColumnsArea: React.FC = ({ children }) => { {features.federating && } {features.federating && } - - + {features.conversations && } + {features.directTimeline ? ( + + ) : ( + + )} {/* Gab groups */} {/* From 16322e8d6c8075418eecc940398542c5d00d2afd Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 30 Apr 2022 11:54:24 -0500 Subject: [PATCH 4/6] Add /signup route --- app/soapbox/containers/soapbox.tsx | 1 + app/soapbox/features/auth_layout/index.tsx | 3 ++- app/soapbox/features/public_layout/components/header.tsx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/soapbox/containers/soapbox.tsx b/app/soapbox/containers/soapbox.tsx index bd3af006d..7bae3a216 100644 --- a/app/soapbox/containers/soapbox.tsx +++ b/app/soapbox/containers/soapbox.tsx @@ -170,6 +170,7 @@ const SoapboxMount = () => { + diff --git a/app/soapbox/features/auth_layout/index.tsx b/app/soapbox/features/auth_layout/index.tsx index c8b2c1bb9..283791ce9 100644 --- a/app/soapbox/features/auth_layout/index.tsx +++ b/app/soapbox/features/auth_layout/index.tsx @@ -10,7 +10,7 @@ import { Card, CardBody } from '../../components/ui'; import LoginPage from '../auth_login/components/login_page'; import PasswordReset from '../auth_login/components/password_reset'; import PasswordResetConfirm from '../auth_login/components/password_reset_confirm'; -// import EmailConfirmation from '../email_confirmation'; +import RegistrationForm from '../auth_login/components/registration_form'; import Verification from '../verification'; import EmailPassthru from '../verification/email_passthru'; @@ -45,6 +45,7 @@ const AuthLayout = () => { + diff --git a/app/soapbox/features/public_layout/components/header.tsx b/app/soapbox/features/public_layout/components/header.tsx index 70f2fcf46..d01f37ebd 100644 --- a/app/soapbox/features/public_layout/components/header.tsx +++ b/app/soapbox/features/public_layout/components/header.tsx @@ -96,7 +96,7 @@ const Header = () => { {(isOpen || features.pepe && pepeOpen) && (