Fix interaction modal layout (#26368)

This commit is contained in:
Claire 2023-08-07 17:58:29 +02:00 committed by GitHub
parent c363978782
commit cd6f2b3cbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 35 deletions

View file

@ -331,16 +331,14 @@ class InteractionModal extends React.PureComponent {
} }
let signupButton; let signupButton;
let signUpOrSignInButton;
if (sso_redirect) { if (sso_redirect) {
signUpOrSignInButton = ( signupButton = (
<a href={sso_redirect} data-method='post' className='button button--block button-tertiary'> <a href={sso_redirect} data-method='post' className='link-button'>
<FormattedMessage id='sign_in_banner.sso_redirect' defaultMessage='Login or Register' /> <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
</a> </a>
) );
} else { } else if (registrationsOpen) {
if(registrationsOpen) {
signupButton = ( signupButton = (
<a href='/auth/sign_up' className='link-button'> <a href='/auth/sign_up' className='link-button'>
<FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' /> <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
@ -348,22 +346,12 @@ class InteractionModal extends React.PureComponent {
); );
} else { } else {
signupButton = ( signupButton = (
<button className='button button--block button-tertiary' onClick={this.handleSignupClick}> <button className='link-button' onClick={this.handleSignupClick}>
<FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' /> <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
</button> </button>
); );
} }
signUpOrSignInButton = (
<>
<a href='/auth/sign_in' className='button button--block'>
<FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Login' />
</a>
{signupButton}
</>
);
}
return ( return (
<div className='modal-root__modal interaction-modal'> <div className='modal-root__modal interaction-modal'>
<div className='interaction-modal__lead'> <div className='interaction-modal__lead'>
@ -371,13 +359,6 @@ class InteractionModal extends React.PureComponent {
<p>{actionDescription} <strong><FormattedMessage id='interaction_modal.sign_in' defaultMessage='You are not logged in to this server. Where is your account hosted?' /></strong></p> <p>{actionDescription} <strong><FormattedMessage id='interaction_modal.sign_in' defaultMessage='You are not logged in to this server. Where is your account hosted?' /></strong></p>
</div> </div>
<div className='interaction-modal__choices'>
<div className='interaction-modal__choices__choice'>
<h3><FormattedMessage id='interaction_modal.on_this_server' defaultMessage='On this server' /></h3>
{signUpOrSignInButton}
</div>
</div>
<IntlLoginForm resourceUrl={url} /> <IntlLoginForm resourceUrl={url} />
<p className='hint'><FormattedMessage id='interaction_modal.sign_in_hint' defaultMessage="Tip: That's the website where you signed up. If you don't remember, look for the welcome e-mail in your inbox. You can also enter your full username! (e.g. @Mastodon@mastodon.social)" /></p> <p className='hint'><FormattedMessage id='interaction_modal.sign_in_hint' defaultMessage="Tip: That's the website where you signed up. If you don't remember, look for the welcome e-mail in your inbox. You can also enter your full username! (e.g. @Mastodon@mastodon.social)" /></p>