import React from 'react'; import { FormattedMessage } from 'react-intl'; import { prepareRequest } from 'soapbox/actions/consumer-auth'; import Markup from 'soapbox/components/markup'; import { Button, Card, CardBody, Stack, Text } from 'soapbox/components/ui'; import VerificationBadge from 'soapbox/components/verification-badge'; import RegistrationForm from 'soapbox/features/auth-login/components/registration-form'; import { useAppDispatch, useFeatures, useInstance, useRegistrationStatus, useSoapboxConfig } from 'soapbox/hooks'; import { capitalize } from 'soapbox/utils/strings'; const LandingPage = () => { const dispatch = useAppDispatch(); const features = useFeatures(); const soapboxConfig = useSoapboxConfig(); const { pepeEnabled, pepeOpen } = useRegistrationStatus(); const instance = useInstance(); /** Registrations are closed */ const renderClosed = () => { return ( ); }; /** Mastodon API registrations are open */ const renderOpen = () => { return ; }; /** Display login button for external provider. */ const renderProvider = () => { const { authProvider } = soapboxConfig; return ( ); }; /** Pepe API registrations are open */ const renderPepe = () => { return ( ); }; // Render registration flow depending on features const renderBody = () => { if (soapboxConfig.authProvider) { return renderProvider(); } else if (pepeEnabled && pepeOpen) { return renderPepe(); } else if (features.accountCreation && instance.registrations) { return renderOpen(); } else { return renderClosed(); } }; return (

{instance.title}

{renderBody()}
); }; export default LandingPage;