@@ -10,12 +10,20 @@ import LoadingIndicator from 'components/LoadingIndicator';
10
10
import PT from 'prop-types' ;
11
11
import React from 'react' ;
12
12
import { Modal , PrimaryButton } from 'topcoder-react-ui-kit' ;
13
- import { COMPOSE } from 'react-css-super-themr ' ;
13
+ import tc from 'components/buttons/themed/tc.scss ' ;
14
14
import style from './style.scss' ;
15
15
import modalStyle from './modal.scss' ;
16
16
17
17
import ConfirmModal from './ConfirmModal' ;
18
18
19
+ /** Themes for buttons
20
+ * those overwrite PrimaryButton style to match achieve various styles.
21
+ * Should implement pattern of classes.
22
+ */
23
+ const buttonThemes = {
24
+ tc,
25
+ } ;
26
+
19
27
export const STATE = {
20
28
CONFIRM_SIGNUP : 'confirm-signup' ,
21
29
DEFAULT : 'default' ,
@@ -55,9 +63,12 @@ export default function NewsletterSignupForMembers({
55
63
showSignupConfirmModal ( ) ;
56
64
} }
57
65
className = { state === STATE . SIGNING ? style . signing : '' }
58
- { ...( theme . link ? { theme : theme . link , composeContextTheme : COMPOSE . SWAP } : { } ) }
66
+ theme = { {
67
+ button : buttonThemes . tc [ 'primary-green-md' ] ,
68
+ disabled : buttonThemes . tc . themedButtonDisabled ,
69
+ } }
59
70
>
60
- { state === STATE . SIGNING ? (
71
+ { state === STATE . SIGNING ? (
61
72
< div className = { style . signingContainer } >
62
73
< span >
63
74
Signing...
@@ -66,31 +77,33 @@ export default function NewsletterSignupForMembers({
66
77
</ div >
67
78
) : label }
68
79
</ PrimaryButton >
69
- { state === STATE . SIGNEDUP ? (
80
+ { state === STATE . SIGNEDUP ? (
70
81
< Modal
71
82
onCancel = { hideSignupButton }
72
83
theme = { modalStyle }
73
84
>
74
- < h1 className = { modalStyle . modalTitle } >
75
- Congratulations!
76
- </ h1 >
77
- < p className = { modalStyle . modalMsg } >
78
- {
79
- customSignupConfirmationText
80
- || 'You are subscribed to the newsletter'
81
- }
82
- </ p >
83
- < PrimaryButton
84
- onClick = { hideSignupButton }
85
- theme = { {
86
- button : style . returnToCommunityButton ,
87
- } }
88
- >
89
- Close
90
- </ PrimaryButton >
85
+ < div className = { modalStyle . modalMsg } >
86
+ < h4 > Congratulations!</ h4 >
87
+ < p style = { { 'font-size' : '24px' } } >
88
+ {
89
+ customSignupConfirmationText
90
+ || 'You are subscribed to the newsletter.'
91
+ }
92
+ </ p >
93
+ </ div >
94
+ < div className = { modalStyle . buttons } >
95
+ < PrimaryButton
96
+ onClick = { hideSignupButton }
97
+ theme = { {
98
+ button : buttonThemes . tc [ 'primary-green-md' ] ,
99
+ } }
100
+ >
101
+ RETURN TO PAGE
102
+ </ PrimaryButton >
103
+ </ div >
91
104
</ Modal >
92
105
) : null }
93
- { state === STATE . CONFIRM_SIGNUP ? (
106
+ { state === STATE . CONFIRM_SIGNUP ? (
94
107
< ConfirmModal
95
108
customTcAuthModalText = { customTcAuthModalText }
96
109
signup = { signup }
@@ -99,28 +112,30 @@ export default function NewsletterSignupForMembers({
99
112
token = { token }
100
113
/>
101
114
) : null }
102
- { state === STATE . ERROR ? (
115
+ { state === STATE . ERROR ? (
103
116
< Modal
104
117
onCancel = { resetSignupButton }
105
118
theme = { modalStyle }
106
119
>
107
- < h1 className = { modalStyle . modalTitle } >
108
- Sorry
109
- </ h1 >
110
- < p className = { modalStyle . modalMsg } >
111
- {
112
- customSignupErrorText
113
- || 'We are not able to subscribe you now. Please try later'
114
- }
115
- </ p >
116
- < PrimaryButton
117
- onClick = { resetSignupButton }
118
- theme = { {
119
- button : style . returnToCommunityButton ,
120
- } }
121
- >
122
- Close
123
- </ PrimaryButton >
120
+ < div className = { modalStyle . modalMsg } >
121
+ < h4 > Sorry</ h4 >
122
+ < p >
123
+ {
124
+ customSignupErrorText
125
+ || 'We are not able to subscribe you now. Please try later.'
126
+ }
127
+ </ p >
128
+ </ div >
129
+ < div className = { modalStyle . buttons } >
130
+ < PrimaryButton
131
+ onClick = { resetSignupButton }
132
+ theme = { {
133
+ button : buttonThemes . tc [ 'primary-green-md' ] ,
134
+ } }
135
+ >
136
+ Close
137
+ </ PrimaryButton >
138
+ </ div >
124
139
</ Modal >
125
140
) : null }
126
141
</ div >
@@ -131,7 +146,6 @@ NewsletterSignupForMembers.defaultProps = {
131
146
customSignupConfirmationText : '' ,
132
147
customSignupErrorText : '' ,
133
148
customTcAuthModalText : '' ,
134
- hiddenButtonText : '' ,
135
149
skipConfirmSignup : false ,
136
150
theme : { } ,
137
151
token : null ,
@@ -141,7 +155,6 @@ NewsletterSignupForMembers.propTypes = {
141
155
customSignupConfirmationText : PT . string ,
142
156
customSignupErrorText : PT . string ,
143
157
customTcAuthModalText : PT . string ,
144
- hiddenButtonText : PT . string ,
145
158
signup : PT . func . isRequired ,
146
159
label : PT . string . isRequired ,
147
160
hideSignupButton : PT . func . isRequired ,
0 commit comments