import classNames from 'classnames'; import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import SiteLogo from 'soapbox/components/site-logo'; import { Button } from 'soapbox/components/ui'; import { Modal } from 'soapbox/components/ui'; import { useAppSelector, useFeatures, useSoapboxConfig } from 'soapbox/hooks'; const messages = defineMessages({ download: { id: 'landing_page_modal.download', defaultMessage: 'Download' }, helpCenter: { id: 'landing_page_modal.helpCenter', defaultMessage: 'Help Center' }, login: { id: 'header.login.label', defaultMessage: 'Log in' }, register: { id: 'header.register.label', defaultMessage: 'Register' }, }); interface ILandingPageModal { onClose: (type: string) => void, } const LandingPageModal: React.FC = ({ onClose }) => { const intl = useIntl(); const soapboxConfig = useSoapboxConfig(); const pepeEnabled = soapboxConfig.getIn(['extensions', 'pepe', 'enabled']) === true; const instance = useAppSelector((state) => state.instance); const features = useFeatures(); const isOpen = features.accountCreation && instance.registrations; const pepeOpen = useAppSelector(state => state.verification.getIn(['instance', 'registrations'], false) === true); return ( } onClose={() => onClose('LANDING_PAGE')} >
{(isOpen || pepeEnabled && pepeOpen) && ( )}
); }; export default LandingPageModal;