[REM] Remove banner, signup prompts are only availalble if registrations are enabled (#119)

This commit is contained in:
Clovis 2022-12-28 14:36:35 +01:00 committed by GitHub
parent fba9a75085
commit 0b785efe30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 27 deletions

View file

@ -7,6 +7,10 @@ import { useAppSelector } from 'soapbox/hooks';
/** Prompts logged-out users to log in when viewing a thread. */
const ThreadLoginCta: React.FC = () => {
const siteTitle = useAppSelector(state => state.instance.title);
const registrationOpen = useAppSelector((state) => state.instance.registrations);
if (!registrationOpen) return null;
return (
<Card className='px-6 py-12 space-y-6 text-center' variant='rounded'>

View file

@ -7,9 +7,10 @@ import { useAppSelector, useSoapboxConfig } from 'soapbox/hooks';
const SignUpPanel = () => {
const { singleUserMode } = useSoapboxConfig();
const siteTitle = useAppSelector((state) => state.instance.title);
const registrationOpen = useAppSelector((state) => state.instance.registrations);
const me = useAppSelector((state) => state.me);
if (me || singleUserMode) return null;
if (me || singleUserMode || !registrationOpen) return null;
return (
<Stack space={2}>

View file

@ -1146,7 +1146,7 @@
"theme_toggle.light": "Clair",
"theme_toggle.system": "Système",
"thread_login.login": "Se connecter",
"thread_login.message": "Rejoingez {siteTitle} pour tout savoir.",
"thread_login.message": "Rejoignez {siteTitle} pour tout savoir.",
"thread_login.signup": "S'inscrire",
"thread_login.title": "Continuez la conversation",
"time_remaining.days": "{number, plural, one {# day} other {# days}} restants",

View file

@ -20,12 +20,6 @@ const DefaultPage: React.FC = ({ children }) => {
<>
<Layout.Main>
{children}
{!me && (
<BundleContainer fetchComponent={CtaBanner}>
{Component => <Component key='cta-banner' />}
</BundleContainer>
)}
</Layout.Main>
<Layout.Aside>

View file

@ -40,14 +40,7 @@ const HomePage: React.FC = ({ children }) => {
<>
<Layout.Main className='pt-3 sm:pt-0 dark:divide-slate-800 space-y-3'>
{features.feedUserFiltering && <FeedCarousel />}
{children}
{!me && (
<BundleContainer fetchComponent={CtaBanner}>
{Component => <Component key='cta-banner' />}
</BundleContainer>
)}
</Layout.Main>
<Layout.Aside>

View file

@ -111,12 +111,6 @@ const ProfilePage: React.FC<IProfilePage> = ({ params, children }) => {
{children}
</div>
</Column>
{!me && (
<BundleContainer fetchComponent={CtaBanner}>
{Component => <Component key='cta-banner' />}
</BundleContainer>
)}
</Layout.Main>
<Layout.Aside>

View file

@ -24,12 +24,6 @@ const StatusPage: React.FC<IStatusPage> = ({ children }) => {
<>
<Layout.Main>
{children}
{!me && (
<BundleContainer fetchComponent={CtaBanner}>
{Component => <Component key='cta-banner' />}
</BundleContainer>
)}
</Layout.Main>
<Layout.Aside>