mirror of
https://github.com/jakejarvis/mastodon-utils.git
synced 2025-04-26 03:25:22 -04:00
156 lines
6.4 KiB
Diff
156 lines
6.4 KiB
Diff
diff --git a/app/javascript/mastodon/features/interaction_modal/index.jsx b/app/javascript/mastodon/features/interaction_modal/index.jsx
|
|
index c1d346fed4..86eeeb14e1 100644
|
|
--- a/app/javascript/mastodon/features/interaction_modal/index.jsx
|
|
+++ b/app/javascript/mastodon/features/interaction_modal/index.jsx
|
|
@@ -1,7 +1,6 @@
|
|
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { FormattedMessage } from 'react-intl';
|
|
-import { registrationsOpen } from 'mastodon/initial_state';
|
|
import { connect } from 'react-redux';
|
|
import Icon from 'mastodon/components/icon';
|
|
import classNames from 'classnames';
|
|
@@ -118,22 +117,6 @@ class InteractionModal extends React.PureComponent {
|
|
break;
|
|
}
|
|
|
|
- let signupButton;
|
|
-
|
|
- if (registrationsOpen) {
|
|
- signupButton = (
|
|
- <a href='/auth/sign_up' className='button button--block button-tertiary'>
|
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
|
- </a>
|
|
- );
|
|
- } else {
|
|
- signupButton = (
|
|
- <button className='button button--block button-tertiary' onClick={this.handleSignupClick}>
|
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
|
- </button>
|
|
- );
|
|
- }
|
|
-
|
|
return (
|
|
<div className='modal-root__modal interaction-modal'>
|
|
<div className='interaction-modal__lead'>
|
|
@@ -145,7 +128,6 @@ class InteractionModal extends React.PureComponent {
|
|
<div className='interaction-modal__choices__choice'>
|
|
<h3><FormattedMessage id='interaction_modal.on_this_server' defaultMessage='On this server' /></h3>
|
|
<a href='/auth/sign_in' className='button button--block'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
|
- {signupButton}
|
|
</div>
|
|
|
|
<div className='interaction-modal__choices__choice'>
|
|
diff --git a/app/javascript/mastodon/features/ui/components/header.jsx b/app/javascript/mastodon/features/ui/components/header.jsx
|
|
index 92adc47a9c..c0e0bdb460 100644
|
|
--- a/app/javascript/mastodon/features/ui/components/header.jsx
|
|
+++ b/app/javascript/mastodon/features/ui/components/header.jsx
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
import Logo from 'mastodon/components/logo';
|
|
import { Link, withRouter } from 'react-router-dom';
|
|
import { FormattedMessage } from 'react-intl';
|
|
-import { registrationsOpen, me } from 'mastodon/initial_state';
|
|
+import { me } from 'mastodon/initial_state';
|
|
import Avatar from 'mastodon/components/avatar';
|
|
import PropTypes from 'prop-types';
|
|
import { connect } from 'react-redux';
|
|
@@ -37,7 +37,7 @@ class Header extends React.PureComponent {
|
|
|
|
render () {
|
|
const { signedIn } = this.context.identity;
|
|
- const { location, openClosedRegistrationsModal } = this.props;
|
|
+ const { location } = this.props;
|
|
|
|
let content;
|
|
|
|
@@ -49,26 +49,9 @@ class Header extends React.PureComponent {
|
|
</>
|
|
);
|
|
} else {
|
|
- let signupButton;
|
|
-
|
|
- if (registrationsOpen) {
|
|
- signupButton = (
|
|
- <a href='/auth/sign_up' className='button button-tertiary'>
|
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
|
- </a>
|
|
- );
|
|
- } else {
|
|
- signupButton = (
|
|
- <button className='button button-tertiary' onClick={openClosedRegistrationsModal}>
|
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
|
- </button>
|
|
- );
|
|
- }
|
|
-
|
|
content = (
|
|
<>
|
|
<a href='/auth/sign_in' className='button'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
|
- {signupButton}
|
|
</>
|
|
);
|
|
}
|
|
diff --git a/app/javascript/mastodon/features/ui/components/sign_in_banner.jsx b/app/javascript/mastodon/features/ui/components/sign_in_banner.jsx
|
|
index 86fcc11b56..eda16f2654 100644
|
|
--- a/app/javascript/mastodon/features/ui/components/sign_in_banner.jsx
|
|
+++ b/app/javascript/mastodon/features/ui/components/sign_in_banner.jsx
|
|
@@ -1,38 +1,11 @@
|
|
-import React, { useCallback } from 'react';
|
|
+import React from 'react';
|
|
import { FormattedMessage } from 'react-intl';
|
|
-import { useDispatch } from 'react-redux';
|
|
-import { registrationsOpen } from 'mastodon/initial_state';
|
|
-import { openModal } from 'mastodon/actions/modal';
|
|
|
|
const SignInBanner = () => {
|
|
- const dispatch = useDispatch();
|
|
-
|
|
- const openClosedRegistrationsModal = useCallback(
|
|
- () => dispatch(openModal('CLOSED_REGISTRATIONS')),
|
|
- [dispatch],
|
|
- );
|
|
-
|
|
- let signupButton;
|
|
-
|
|
- if (registrationsOpen) {
|
|
- signupButton = (
|
|
- <a href='/auth/sign_up' className='button button--block button-tertiary'>
|
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
|
- </a>
|
|
- );
|
|
- } else {
|
|
- signupButton = (
|
|
- <button className='button button--block button-tertiary' onClick={openClosedRegistrationsModal}>
|
|
- <FormattedMessage id='sign_in_banner.create_account' defaultMessage='Create account' />
|
|
- </button>
|
|
- );
|
|
- }
|
|
-
|
|
return (
|
|
<div className='sign-in-banner'>
|
|
<p><FormattedMessage id='sign_in_banner.text' defaultMessage='Sign in to follow profiles or hashtags, favourite, share and reply to posts. You can also interact from your account on a different server.' /></p>
|
|
<a href='/auth/sign_in' className='button button--block'><FormattedMessage id='sign_in_banner.sign_in' defaultMessage='Sign in' /></a>
|
|
- {signupButton}
|
|
</div>
|
|
);
|
|
};
|
|
diff --git a/app/views/auth/shared/_links.html.haml b/app/views/auth/shared/_links.html.haml
|
|
index f078e2f7ec..6e106cd92d 100644
|
|
--- a/app/views/auth/shared/_links.html.haml
|
|
+++ b/app/views/auth/shared/_links.html.haml
|
|
@@ -5,14 +5,8 @@
|
|
- if controller_name != 'sessions'
|
|
%li= link_to_login t('auth.login')
|
|
|
|
- - if controller_name != 'registrations'
|
|
- %li= link_to t('auth.register'), available_sign_up_path
|
|
-
|
|
- if controller_name != 'passwords' && controller_name != 'registrations'
|
|
%li= link_to t('auth.forgot_password'), new_user_password_path
|
|
|
|
- - if controller_name != 'confirmations' && (!user_signed_in? || !current_user.confirmed? || current_user.unconfirmed_email.present?)
|
|
- %li= link_to t('auth.didnt_get_confirmation'), new_user_confirmation_path
|
|
-
|
|
- if user_signed_in? && controller_name != 'setup'
|
|
%li= link_to t('auth.logout'), destroy_user_session_path, data: { method: :delete }
|