Skip to content

Commit 210f8c6

Browse files
committed
Update #4017
1 parent 6de9db1 commit 210f8c6

File tree

8 files changed

+159
-86
lines changed

8 files changed

+159
-86
lines changed

src/shared/components/Contentful/ContentBlock/themes/TCO19.scss

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
h6 {
4646
margin: 10px 0 10px;
4747
color: $tco-black;
48-
text-transform: uppercase;
4948
}
5049

5150
@include TCO19-default-headers;

src/shared/components/Contentful/ContentBlock/themes/TCO20.scss

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
h6 {
4646
margin: 20px 0 10px;
4747
color: $tco-black;
48-
text-transform: uppercase;
4948
}
5049

5150
@include TCO19-default-headers;

src/shared/components/Contentful/ContentBlock/themes/_TCO19_thypo.scss

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
font-size: 80px;
66
line-height: 74px;
7+
text-transform: uppercase;
78

89
@include xs-to-sm {
910
font-size: 42px;
@@ -17,6 +18,7 @@
1718

1819
font-size: 60px;
1920
line-height: 58px;
21+
text-transform: uppercase;
2022

2123
@include xs-to-sm {
2224
font-size: 36px;
@@ -29,6 +31,7 @@
2931

3032
font-size: 48px;
3133
line-height: 50px;
34+
text-transform: uppercase;
3235

3336
@include xs-to-sm {
3437
font-size: 31px;
@@ -42,6 +45,7 @@
4245

4346
font-size: 34px;
4447
line-height: 38px;
48+
text-transform: uppercase;
4549

4650
@include xs-to-sm {
4751
font-size: 25px;
@@ -56,6 +60,7 @@
5660
font-size: 24px;
5761
line-height: 26px;
5862
font-weight: 500;
63+
text-transform: uppercase;
5964

6065
@include xs-to-sm {
6166
font-size: 21px;
@@ -70,6 +75,7 @@
7075
font-size: 20px;
7176
line-height: 24px;
7277
font-weight: 500;
78+
text-transform: uppercase;
7379

7480
@include xs-to-sm {
7581
font-size: 18px;

src/shared/components/NewsletterSignupForMembers/ConfirmModal/index.jsx

+38-20
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@
1111

1212
import PT from 'prop-types';
1313
import React from 'react';
14-
import { Modal, PrimaryButton, SecondaryButton } from 'topcoder-react-ui-kit';
14+
import { Modal, PrimaryButton } from 'topcoder-react-ui-kit';
1515
import { config } from 'topcoder-react-utils';
1616
import { themr } from 'react-css-super-themr';
17+
import tc from 'components/buttons/themed/tc.scss';
1718
import defaultStyle from './style.scss';
19+
import modalStyle from '../modal.scss';
20+
21+
/** Themes for buttons
22+
* those overwrite PrimaryButton style to match achieve various styles.
23+
* Should implement pattern of classes.
24+
*/
25+
const buttonThemes = {
26+
tc,
27+
};
28+
1829

1930
function ConfirmModal({
2031
customTcAuthModalText,
@@ -27,20 +38,20 @@ function ConfirmModal({
2738
let text;
2839
if (token) {
2940
text = (
30-
<p>
31-
Do you want to subscribe to this newsletter?
32-
</p>
41+
<div className={modalStyle.modalMsg}>
42+
<h4>Sign up for the Topcoder Newsletter</h4>
43+
<p style={{ 'font-size': '24px' }}>Do you want to subscribe to this newsletter?</p>
44+
</div>
3345
);
3446
if (skipConfirmSignup) {
3547
setImmediate(() => signup());
3648
}
3749
} else {
3850
text = customTcAuthModalText || (
39-
<div>
51+
<div className={modalStyle.modalMsg}>
52+
<h4>Sign up for the Topcoder Newsletter</h4>
4053
<p>
4154
You must be a Topcoder member before you can signup for Newsletter.
42-
</p>
43-
<p>
4455
To signup, login if you are already a member. If not, register first.
4556
</p>
4657
</div>
@@ -60,15 +71,21 @@ function ConfirmModal({
6071
{ token ? (
6172
<div className={theme.signupButtons}>
6273
<PrimaryButton
63-
onClick={() => signup()}
74+
onClick={resetSignupButton}
75+
theme={{
76+
button: buttonThemes.tc['primary-white-md'],
77+
}}
6478
>
65-
Signup
79+
CANCEL
6680
</PrimaryButton>
67-
<SecondaryButton
68-
onClick={resetSignupButton}
81+
<PrimaryButton
82+
onClick={() => signup()}
83+
theme={{
84+
button: buttonThemes.tc['primary-green-md'],
85+
}}
6986
>
70-
Cancel
71-
</SecondaryButton>
87+
SIGNUP
88+
</PrimaryButton>
7289
</div>
7390
) : (
7491
<div className={theme.loginButtons}>
@@ -77,8 +94,11 @@ function ConfirmModal({
7794
const url = encodeURIComponent(autoSignupUrl);
7895
window.location = `${config.URL.AUTH}/member?retUrl=${url}`;
7996
}}
97+
theme={{
98+
button: buttonThemes.tc['primary-white-md'],
99+
}}
80100
>
81-
Login
101+
LOGIN
82102
</PrimaryButton>
83103
<PrimaryButton
84104
onClick={() => {
@@ -87,14 +107,12 @@ function ConfirmModal({
87107
url = encodeURIComponent(url);
88108
window.location = `${config.URL.AUTH}/member/registration?retUrl=${url}`;
89109
}}
110+
theme={{
111+
button: buttonThemes.tc['primary-green-md'],
112+
}}
90113
>
91-
Register
114+
REGISTER
92115
</PrimaryButton>
93-
<SecondaryButton
94-
onClick={resetSignupButton}
95-
>
96-
Cancel
97-
</SecondaryButton>
98116
</div>
99117
)}
100118
</Modal>
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
@import "~styles/mixins";
22

33
.container {
4-
padding: 10px;
5-
width: 520px;
4+
padding: 90px 60px;
5+
width: 629px;
6+
height: 440px;
7+
border-radius: 10px;
8+
display: flex;
9+
flex-direction: column;
10+
justify-content: center;
611
}
712

8-
.confirmMsg {
9-
@include tc-body-md;
10-
11-
color: #787d81;
12-
text-align: center;
13-
padding-bottom: 10px;
13+
.overlay {
14+
background-color: #2a2a2a;
15+
opacity: 0.95;
1416
}
1517

16-
.signupButtons,
17-
.loginButtons {
18+
.confirmMsg {
1819
text-align: center;
1920

20-
button {
21-
margin: 24px 12px 0;
21+
h4 {
22+
margin-bottom: 20px;
2223
}
23-
}
2424

25-
.joinButtons {
26-
button {
27-
width: 100px;
25+
p {
26+
padding: 0 50px;
2827
}
2928
}
3029

30+
.signupButtons,
3131
.loginButtons {
32+
text-align: center;
33+
3234
button {
33-
width: 200px;
35+
margin: 24px 12px 0;
3436
}
3537
}

src/shared/components/NewsletterSignupForMembers/index.jsx

+55-42
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@ import LoadingIndicator from 'components/LoadingIndicator';
1010
import PT from 'prop-types';
1111
import React from 'react';
1212
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';
1414
import style from './style.scss';
1515
import modalStyle from './modal.scss';
1616

1717
import ConfirmModal from './ConfirmModal';
1818

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+
1927
export const STATE = {
2028
CONFIRM_SIGNUP: 'confirm-signup',
2129
DEFAULT: 'default',
@@ -55,9 +63,12 @@ export default function NewsletterSignupForMembers({
5563
showSignupConfirmModal();
5664
}}
5765
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+
}}
5970
>
60-
{ state === STATE.SIGNING ? (
71+
{state === STATE.SIGNING ? (
6172
<div className={style.signingContainer}>
6273
<span>
6374
Signing...
@@ -66,31 +77,33 @@ export default function NewsletterSignupForMembers({
6677
</div>
6778
) : label}
6879
</PrimaryButton>
69-
{ state === STATE.SIGNEDUP ? (
80+
{state === STATE.SIGNEDUP ? (
7081
<Modal
7182
onCancel={hideSignupButton}
7283
theme={modalStyle}
7384
>
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>
91104
</Modal>
92105
) : null}
93-
{ state === STATE.CONFIRM_SIGNUP ? (
106+
{state === STATE.CONFIRM_SIGNUP ? (
94107
<ConfirmModal
95108
customTcAuthModalText={customTcAuthModalText}
96109
signup={signup}
@@ -99,28 +112,30 @@ export default function NewsletterSignupForMembers({
99112
token={token}
100113
/>
101114
) : null}
102-
{ state === STATE.ERROR ? (
115+
{state === STATE.ERROR ? (
103116
<Modal
104117
onCancel={resetSignupButton}
105118
theme={modalStyle}
106119
>
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>
124139
</Modal>
125140
) : null}
126141
</div>
@@ -131,7 +146,6 @@ NewsletterSignupForMembers.defaultProps = {
131146
customSignupConfirmationText: '',
132147
customSignupErrorText: '',
133148
customTcAuthModalText: '',
134-
hiddenButtonText: '',
135149
skipConfirmSignup: false,
136150
theme: {},
137151
token: null,
@@ -141,7 +155,6 @@ NewsletterSignupForMembers.propTypes = {
141155
customSignupConfirmationText: PT.string,
142156
customSignupErrorText: PT.string,
143157
customTcAuthModalText: PT.string,
144-
hiddenButtonText: PT.string,
145158
signup: PT.func.isRequired,
146159
label: PT.string.isRequired,
147160
hideSignupButton: PT.func.isRequired,

0 commit comments

Comments
 (0)