From 64cce966a2a9535c4eaa1ca3827acef52889407e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 11 May 2022 14:50:53 -0500 Subject: [PATCH] Simplify signup routing --- app/soapbox/containers/soapbox.tsx | 25 ++++++++++++++++--- .../public_layout/components/header.tsx | 2 +- .../components/modals/landing-page-modal.tsx | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/soapbox/containers/soapbox.tsx b/app/soapbox/containers/soapbox.tsx index 500a7b67d..7386db1b6 100644 --- a/app/soapbox/containers/soapbox.tsx +++ b/app/soapbox/containers/soapbox.tsx @@ -86,6 +86,7 @@ const SoapboxMount = () => { const [isSystemDarkMode, setSystemDarkMode] = useState(colorSchemeQueryList.matches); const userTheme = settings.get('themeMode'); const darkMode = userTheme === 'dark' || (userTheme === 'system' && isSystemDarkMode); + const pepeEnabled = soapboxConfig.getIn(['extensions', 'pepe', 'enabled']) === true; const themeCss = generateThemeCss(soapboxConfig); @@ -171,20 +172,38 @@ const SoapboxMount = () => { - {waitlisted && } />} + {/* Redirect signup route depending on Pepe enablement. */} + {/* We should prefer using /signup in components. */} + {pepeEnabled ? ( + + ): ( + + )} + + {waitlisted && ( + } /> + )} {!me && (singleUserMode ? : )} - {!me && } + {!me && ( + + )} + + {(features.accountCreation && instance.registrations) && ( )} - + + {pepeEnabled && ( + + )} + diff --git a/app/soapbox/features/public_layout/components/header.tsx b/app/soapbox/features/public_layout/components/header.tsx index 63e03c472..448de77f7 100644 --- a/app/soapbox/features/public_layout/components/header.tsx +++ b/app/soapbox/features/public_layout/components/header.tsx @@ -104,7 +104,7 @@ const Header = () => { {(isOpen || pepeEnabled && pepeOpen) && ( {(isOpen || pepeEnabled && pepeOpen) && ( - )}