-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhide-signup.patch
136 lines (130 loc) · 5.62 KB
/
hide-signup.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
diff --git a/app/javascript/flavours/glitch/features/interaction_modal/index.jsx b/app/javascript/flavours/glitch/features/interaction_modal/index.jsx
index 3a54105a36..ba95369fe8 100644
--- a/app/javascript/flavours/glitch/features/interaction_modal/index.jsx
+++ b/app/javascript/flavours/glitch/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 'flavours/glitch/initial_state';
import { connect } from 'react-redux';
import Icon from 'flavours/glitch/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/flavours/glitch/features/ui/components/header.jsx b/app/javascript/flavours/glitch/features/ui/components/header.jsx
index d9ad949611..436c001f74 100644
--- a/app/javascript/flavours/glitch/features/ui/components/header.jsx
+++ b/app/javascript/flavours/glitch/features/ui/components/header.jsx
@@ -2,7 +2,7 @@ import React from 'react';
import Logo from 'flavours/glitch/components/logo';
import { Link, withRouter } from 'react-router-dom';
import { FormattedMessage } from 'react-intl';
-import { registrationsOpen, me } from 'flavours/glitch/initial_state';
+import { me } from 'flavours/glitch/initial_state';
import Avatar from 'flavours/glitch/components/avatar';
import Permalink from 'flavours/glitch/components/permalink';
import PropTypes from 'prop-types';
@@ -38,7 +38,7 @@ class Header extends React.PureComponent {
render () {
const { signedIn } = this.context.identity;
- const { location, openClosedRegistrationsModal } = this.props;
+ const { location } = this.props;
let content;
@@ -50,26 +50,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/flavours/glitch/features/ui/components/sign_in_banner.jsx b/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx
index c0d62aca00..eda16f2654 100644
--- a/app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx
+++ b/app/javascript/flavours/glitch/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 'flavours/glitch/initial_state';
-import { openModal } from 'flavours/glitch/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>
);
};