import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import VerificationBadge from 'soapbox/components/verification_badge'; import RegistrationForm from 'soapbox/features/auth_login/components/registration_form'; import { useAppSelector, useSoapboxConfig } from 'soapbox/hooks'; import { Button, Card, CardBody, Stack, Text } from '../../components/ui'; const LandingPage = () => { const soapboxConfig = useSoapboxConfig(); const pepeEnabled = soapboxConfig.getIn(['extensions', 'pepe', 'enabled']) === true; const instance = useAppSelector((state) => state.instance); const pepeOpen = useAppSelector(state => state.verification.getIn(['instance', 'registrations'], false) === true); /** Registrations are closed */ const renderClosed = () => { return ( ); }; /** Mastodon API registrations are open */ const renderOpen = () => { return ; }; /** Pepe API registrations are open */ const renderPepe = () => { return ( Let's get started! Social Media Without Discrimination Create an account ); }; // Render registration flow depending on features const renderBody = () => { if (pepeEnabled && pepeOpen) { return renderPepe(); } else if (instance.registrations) { return renderOpen(); } else { return renderClosed(); } }; return ( {instance.title} {instance.description} {renderBody()} ); }; export default LandingPage;