Skip to content

Commit b3bdc1f

Browse files
Merge pull request #5468 from topcoder-platform/gig-login-modal-update
Gig login modal update
2 parents 61a254c + fcca0f3 commit b3bdc1f

File tree

6 files changed

+1009
-21
lines changed

6 files changed

+1009
-21
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ workflows:
283283
filters:
284284
branches:
285285
only:
286-
- FAQ-theme
286+
- gig-login-modal-update
287287
# This is alternate dev env for parallel testing
288288
- "build-qa":
289289
context : org-global

src/assets/images/thinking-face-laptop-tablet.svg

Lines changed: 433 additions & 0 deletions
Loading

src/assets/images/thinking-face-mobile.svg

Lines changed: 433 additions & 0 deletions
Loading

src/shared/components/Contentful/Route.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { Route, Switch, Redirect } from 'react-router-dom';
1414
import Viewport from 'components/Contentful/Viewport';
1515
import PasswordScreen from 'components/Contentful/PasswordScreen';
1616
import { isomorphy } from 'topcoder-react-utils';
17+
import { removeTrailingSlash } from 'utils/url';
1718

1819
// Concatenates a base and segment and handles optional trailing slashes
1920
const buildUrl = (base, segment) => `${_.trimEnd(base, '/')}/${_.trim(segment, '/')}`;
@@ -169,8 +170,10 @@ export default function ContentfulRoute(props) {
169170
render={(data) => {
170171
const { fields } = Object.values(data.entries.items)[0];
171172
const url = path || buildUrl(baseUrl, fields.url);
173+
// eslint-disable-next-line no-restricted-globals
174+
const currentPathname = typeof location === 'undefined' ? '' : removeTrailingSlash(location.pathname);
172175
const redirectToUrl = _.trim(fields.redirectToUrl);
173-
return redirectToUrl ? (
176+
return redirectToUrl && currentPathname === url ? (
174177
<RedirectWithStatus status={301} from={url} to={redirectToUrl} />
175178
) : (
176179
<Route

src/shared/components/Gigs/LoginModal/index.jsx

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable max-len */
12
/**
23
* The modal used for login enforcing
34
*/
@@ -8,7 +9,11 @@ import PT from 'prop-types';
89
import React from 'react';
910
import { Modal, PrimaryButton } from 'topcoder-react-ui-kit';
1011
import { config } from 'topcoder-react-utils';
12+
import SVG from 'react-inlinesvg';
13+
import MediaQuery from 'react-responsive';
1114
import tc from 'components/buttons/themed/tc.scss';
15+
import ThinkingFaceMobile from 'assets/images/thinking-face-mobile.svg';
16+
import ThinkingFace from 'assets/images/thinking-face-laptop-tablet.svg';
1217
import modalStyle from './modal.scss';
1318

1419
/** Themes for buttons
@@ -19,28 +24,49 @@ const buttonThemes = {
1924
tc,
2025
};
2126

27+
const blobYellow = 'https://images.ctfassets.net/b5f1djy59z3a/3wYRUnrUj3v765abrGRwlM/b0f9b49b4f49dc163e6913559a19b9e3/blob-yellow.svg';
28+
const progressBar = 'https://images.ctfassets.net/b5f1djy59z3a/2BX7LOrvVzKEarIJ8boCFm/bba0dd3e0180d2dc355809e6c1954631/progress-bar.svg';
29+
const progressBarMid = 'https://images.ctfassets.net/b5f1djy59z3a/517ZRt9geweW3QTtzlUqJu/11e33e876426f97e0725ba5fff9755f8/progress-bar-mid.svg';
30+
const progressBarXS = 'https://images.ctfassets.net/b5f1djy59z3a/6QxH7uVKCngtzBaXDn3Od1/3e0222a1ce773cead3f3a45f291f43a6/progress-bar-mobile.svg';
31+
const blobPurple = 'https://images.ctfassets.net/b5f1djy59z3a/1ZRCwp1uoShcES16lQmeu/ba084734120ffedebcb92b4e3fa2d667/blob-purple.svg';
32+
2233
function LoginModal({ retUrl, onCancel }) {
2334
return (
2435
<Modal
2536
theme={modalStyle}
2637
onCancel={onCancel}
2738
>
2839
<div className={modalStyle.loginRequired}>
29-
<h3 className={modalStyle.title}>WARNING</h3>
30-
<p className={modalStyle.loginMsg}>You must be a Topcoder member to apply!</p>
40+
<SVG src={blobYellow} className={modalStyle.blobYellow} />
41+
<h3 className={modalStyle.title}>YAY! You are almost done!</h3>
42+
<p className={modalStyle.loginMsg}>
43+
Looks like you&apos;re not a Topcoder member yet. Or maybe
44+
you&apos;re not logged in?<MediaQuery maxDeviceWidth={425}><ThinkingFaceMobile className={modalStyle.thinkingFace} /></MediaQuery><MediaQuery minDeviceWidth={426}><ThinkingFace className={modalStyle.thinkingFace} /></MediaQuery>
45+
It&apos;s quick to register and it&apos;s free!
46+
</p>
47+
<MediaQuery minDeviceWidth={769}>
48+
<SVG src={progressBar} className={modalStyle.progressBar} />
49+
</MediaQuery>
50+
<MediaQuery maxDeviceWidth={768} minDeviceWidth={630}>
51+
<SVG src={progressBarMid} className={modalStyle.progressBar} />
52+
</MediaQuery>
53+
<MediaQuery maxDeviceWidth={630}>
54+
<SVG src={progressBarXS} className={modalStyle.progressBar} />
55+
</MediaQuery>
3156
<div className={modalStyle.ctaButtons}>
3257
<PrimaryButton
3358
onClick={() => {
34-
window.location = `${config.URL.AUTH}/member?retUrl=${encodeURIComponent(retUrl)}`;
59+
window.location = `${config.URL.AUTH}/member/registration?retUrl=${encodeURIComponent(retUrl)}&mode=signUp&utm_source=gig_listing`;
3560
}}
3661
theme={{
3762
button: buttonThemes.tc['primary-green-md'],
3863
}}
3964
>
40-
LOGIN
65+
REGISTER NOW
4166
</PrimaryButton>
4267
</div>
43-
<p className={modalStyle.regTxt}>Not a member? It is free to <a href={`${config.URL.AUTH}/member/registration?retUrl=${encodeURIComponent(retUrl)}&mode=signUp&utm_source=gig_listing`}>register</a>!</p>
68+
<p className={modalStyle.regTxt}>Already a member? <a href={`${config.URL.AUTH}/member?retUrl=${encodeURIComponent(retUrl)}`}>Login here</a></p>
69+
<SVG src={blobPurple} className={modalStyle.blobPurple} />
4470
</div>
4571
</Modal>
4672
);

src/shared/components/Gigs/LoginModal/modal.scss

Lines changed: 107 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
.container {
55
padding: 0;
66
width: auto;
7-
max-width: 95vw;
7+
max-width: 727px;
88
height: auto;
9-
max-height: 95vh;
9+
max-height: none;
1010
border-radius: 10px;
1111
display: flex;
1212
flex-direction: column;
@@ -15,21 +15,58 @@
1515
@include gui-kit-headers;
1616
@include gui-kit-content;
1717

18+
@media (min-width: 757px) {
19+
width: 727px;
20+
}
21+
22+
@media (min-width: 630px) and (max-width: 757px) {
23+
width: 600px;
24+
}
25+
26+
@media (max-width: 630px) {
27+
width: 290px;
28+
max-height: none;
29+
top: 42%;
30+
}
31+
1832
.title {
19-
color: #1e94a3;
33+
color: #9d41c9;
2034
font-family: BarlowCondensed, sans-serif;
21-
font-size: 34px;
22-
line-height: 38px;
35+
font-size: 60px;
36+
line-height: 58px;
2337
font-weight: 500;
2438
margin: 0;
25-
margin-bottom: 20px;
39+
margin-bottom: 30px;
40+
41+
@include xs-to-sm {
42+
max-width: 400px;
43+
margin: auto;
44+
font-size: 60px !important;
45+
line-height: 58px !important;
46+
margin-bottom: 30px;
47+
}
48+
49+
@media (max-width: 425px) {
50+
max-width: 230px;
51+
margin: auto;
52+
font-size: 36px !important;
53+
line-height: 34px !important;
54+
margin-bottom: 30px;
55+
}
2656
}
2757

2858
.loginMsg {
29-
color: #ef476f;
59+
color: #2a2a2a;
3060
font-size: 24px;
3161
line-height: 36px;
32-
margin-bottom: 20px;
62+
margin-bottom: 40px;
63+
64+
@media (max-width: 425px) {
65+
text-align: left !important;
66+
font-size: 20px;
67+
line-height: 30px;
68+
margin-bottom: 30px;
69+
}
3370
}
3471

3572
.ctaButtons {
@@ -61,20 +98,76 @@
6198
}
6299
}
63100

64-
.loginRequired,
65-
.referrSucess {
101+
.loginRequired {
66102
display: flex;
67103
flex-direction: column;
68-
padding: 100px 80px;
104+
padding: 80px 55px 40px 60px;
69105
text-align: center;
106+
position: relative;
70107

71108
@include xs-to-sm {
72-
padding: 50px 40px;
109+
padding: 50px 35px 40px;
110+
}
111+
112+
@media (max-width: 425px) {
113+
padding: 50px 15px 70px;
114+
}
115+
116+
.progressBar {
117+
width: 100%;
118+
119+
@include xs {
120+
margin-bottom: 40px;
121+
}
122+
123+
svg {
124+
max-width: 100%;
125+
}
126+
}
127+
128+
.blobYellow,
129+
.blobPurple {
130+
position: absolute;
131+
z-index: -1;
132+
133+
svg {
134+
max-width: 100%;
135+
}
136+
}
137+
138+
.blobYellow {
139+
top: 0;
140+
right: 0;
141+
142+
@media (max-width: 425px) {
143+
max-width: 62px;
144+
}
145+
}
146+
147+
.blobPurple {
148+
bottom: -5px;
149+
left: 0;
150+
151+
@media (max-width: 425px) {
152+
max-width: 84px;
153+
bottom: -40px;
154+
}
155+
}
156+
157+
.thinkingFace {
158+
width: 23px;
159+
margin: 0 5px;
160+
transform: translateY(4px);
161+
162+
@media (max-width: 425px) {
163+
width: 21px;
164+
transform: translateY(2px);
165+
}
73166
}
74167

75168
.regTxt {
76-
font-size: 14px;
77-
margin: 10px 0 0;
169+
font-size: 16px;
170+
margin: 30px 0 0;
78171
}
79172
}
80173
}

0 commit comments

Comments
 (0)