import { useCallback } from 'react'; import { FormattedMessage } from 'react-intl'; import { openModal } from 'mastodon/actions/modal'; import { registrationsOpen, sso_redirect } from 'mastodon/initial_state'; import { useAppDispatch, useAppSelector } from 'mastodon/store'; const SignInBanner = () => { const dispatch = useAppDispatch(); const openClosedRegistrationsModal = useCallback( () => dispatch(openModal({ modalType: 'CLOSED_REGISTRATIONS' })), [dispatch], ); let signupButton; const signupUrl = useAppSelector((state) => state.getIn(['server', 'server', 'registrations', 'url'], null) || '/auth/sign_up'); if (sso_redirect) { return (

) } if (registrationsOpen) { signupButton = ( ); } else { signupButton = ( ); } return (

{signupButton}
); }; export default SignInBanner;