Skip to content

Commit 33936b3

Browse files
Merge pull request #5464 from topcoder-platform/develop
Release 2021/04/05 (v1.8.4)
2 parents e64cd49 + 61a254c commit 33936b3

File tree

12 files changed

+189
-32
lines changed

12 files changed

+189
-32
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,21 +283,21 @@ workflows:
283283
filters:
284284
branches:
285285
only:
286-
- gig-application-update
286+
- FAQ-theme
287287
# This is alternate dev env for parallel testing
288288
- "build-qa":
289289
context : org-global
290290
filters:
291291
branches:
292292
only:
293-
- free
293+
- bug-bash
294294
# This is beta env for production soft releases
295295
- "build-prod-beta":
296296
context : org-global
297297
filters:
298298
branches:
299299
only:
300-
- develop
300+
- bug-bash
301301
# This is stage env for production QA releases
302302
- "build-prod-staging":
303303
context : org-global

config/default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ module.exports = {
140140
HOWTOCOMPETEINMARATHON: 'https://www.topcoder.com/thrive/articles/How%20To%20Compete%20in%20a%20Marathon%20Match',
141141
USABLECODEDEV: 'https://www.topcoder.com/thrive/articles/Usable%20Code%20in%20Dev%20Challenges',
142142
EXTENSIONVSCODE: 'https://marketplace.visualstudio.com/items?itemName=Topcoder.topcoder-workflow&ssr=false#overview',
143+
TEMPLATES_REPO: 'https://github.com/topcoder-platform-templates',
143144
},
144145

145146
IOS: 'https://ios.topcoder-dev.com',
Lines changed: 19 additions & 0 deletions
Loading

src/shared/components/Contentful/Dropdown/DropdownItem.jsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
import React from 'react';
66
import PT from 'prop-types';
77
import MarkdownRenderer from 'components/MarkdownRenderer';
8+
import { themr } from 'react-css-super-themr';
9+
import defaultTheme from './themes/item.scss';
10+
import darkTheme from './themes/item-dark.scss';
811

9-
import './item.scss';
10-
12+
const THEMES = {
13+
Default: defaultTheme,
14+
'Dark mode': darkTheme,
15+
};
1116
class DropdownItem extends React.Component {
1217
constructor(props) {
1318
super(props);
@@ -24,24 +29,24 @@ class DropdownItem extends React.Component {
2429
}
2530

2631
render() {
27-
const { data } = this.props;
32+
const { data, baseTheme } = this.props;
2833
const { isActive } = this.state;
2934
return (
30-
<div styleName="container" id={data.sys.id}>
35+
<div className={THEMES[baseTheme].container} id={data.sys.id}>
3136
<div
3237
tabIndex={0}
3338
role="button"
3439
onKeyPress={e => (e.key === 'Enter' ? null : null)}
35-
styleName={isActive ? 'question active' : 'question'}
40+
className={isActive ? THEMES[baseTheme]['question-active'] : THEMES[baseTheme].question}
3641
onClick={() => this.toggleActive()}
3742
>
38-
<div styleName="text">
43+
<div className={THEMES[baseTheme].text}>
3944
{data.fields.title}
4045
</div>
41-
<div styleName={isActive ? 'toggle-arrow active' : 'toggle-arrow'} />
46+
<div className={isActive ? THEMES[baseTheme]['toggle-arrow-active'] : THEMES[baseTheme]['toggle-arrow']} />
4247
</div>
4348
<div
44-
styleName={isActive ? 'answer active' : 'answer'}
49+
className={isActive ? THEMES[baseTheme]['answer-active'] : THEMES[baseTheme].answer}
4550
>
4651
<MarkdownRenderer markdown={data.fields.text} {...this.props} />
4752
</div>
@@ -55,6 +60,7 @@ DropdownItem.defaultProps = {
5560
spaceName: null,
5661
environment: null,
5762
isActive: false,
63+
baseTheme: 'Default',
5864
};
5965

6066
DropdownItem.propTypes = {
@@ -63,6 +69,7 @@ DropdownItem.propTypes = {
6369
preview: PT.bool,
6470
spaceName: PT.string,
6571
environment: PT.string,
72+
baseTheme: PT.string,
6673
};
6774

68-
export default DropdownItem;
75+
export default themr('DropdownItem', defaultTheme)(DropdownItem);

src/shared/components/Contentful/Dropdown/index.jsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@ import React from 'react';
1010
import { fixStyle } from 'utils/contentful';
1111
import DropdownItem from './DropdownItem';
1212

13-
import defaultTheme from './default.scss';
13+
import defaultTheme from './themes/default.scss';
14+
import darkTheme from './themes/dark.scss';
15+
16+
const THEMES = {
17+
Default: defaultTheme,
18+
'Dark mode': darkTheme,
19+
};
1420

1521
function DropdownItemsLoader(props) {
1622
const {
1723
ids,
1824
preview,
1925
spaceName,
2026
environment,
27+
baseTheme,
2128
} = props;
2229

2330
return (
@@ -34,6 +41,7 @@ function DropdownItemsLoader(props) {
3441
spaceName={spaceName}
3542
environment={environment}
3643
key={item.sys.id}
44+
baseTheme={baseTheme}
3745
/>
3846
))
3947
)}
@@ -53,6 +61,7 @@ DropdownItemsLoader.propTypes = {
5361
preview: PT.bool,
5462
spaceName: PT.string,
5563
environment: PT.string,
64+
baseTheme: PT.string.isRequired,
5665
};
5766

5867
/* Loads the dropdown entry. */
@@ -69,20 +78,23 @@ export default function DropdownLoader(props) {
6978
render={(data) => {
7079
const { fields } = Object.values(data.entries.items)[0];
7180
if (!fields) return null;
81+
let { theme } = fields;
82+
theme = theme || 'Default';
7283
return (
7384
<div
74-
className={defaultTheme.container}
85+
className={THEMES[theme].container}
7586
style={fixStyle(fields.extraStylesForContainer)}
7687
>
7788
<div
78-
className={defaultTheme.contentWrapper}
89+
className={THEMES[theme].contentWrapper}
7990
style={fixStyle(fields.extraStylesForContentWrapper)}
8091
>
8192
<DropdownItemsLoader
8293
ids={_.map(fields.items, 'sys.id')}
8394
preview={preview}
8495
spaceName={spaceName}
8596
environment={environment}
97+
baseTheme={theme}
8698
/>
8799
</div>
88100
</div>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@import "~styles/mixins";
2+
3+
.container {
4+
padding: 0;
5+
6+
@include xs-to-sm {
7+
padding: 0 15px;
8+
}
9+
}
10+
11+
.contentWrapper {
12+
display: flex;
13+
margin: 0 auto;
14+
max-width: $screen-md;
15+
color: #fff;
16+
flex-direction: column;
17+
border-top: 1px solid rgba(212, 212, 212, 0.4);
18+
}

src/shared/components/Contentful/Dropdown/default.scss renamed to src/shared/components/Contentful/Dropdown/themes/default.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
display: flex;
1313
margin: 0 auto;
1414
max-width: $screen-md;
15-
color: black;
15+
color: #2a2a2a;
1616
flex-direction: column;
1717
border-top: 1px solid #d4d4d4;
1818
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
@import "~styles/mixins";
2+
@import "~components/Contentful/default";
3+
4+
.container {
5+
width: 100%;
6+
}
7+
8+
.question,
9+
.question-active {
10+
display: flex;
11+
align-items: center;
12+
justify-content: space-between;
13+
height: 82px;
14+
outline: none;
15+
cursor: pointer;
16+
border-bottom: 1px solid rgba(212, 212, 212, 0.4);
17+
}
18+
19+
.question-active {
20+
border-bottom: none;
21+
height: 81px;
22+
}
23+
24+
.answer,
25+
.answer-active {
26+
@include gui-kit-content;
27+
@include gui-kit-headers;
28+
29+
display: none;
30+
padding: 5px 70px 24px 0;
31+
color: #fff;
32+
33+
@include xs-to-sm {
34+
padding-right: 0;
35+
}
36+
37+
p {
38+
color: #fff;
39+
}
40+
}
41+
42+
.answer-active {
43+
display: block;
44+
border-bottom: 1px solid rgba(212, 212, 212, 0.4);
45+
}
46+
47+
.text {
48+
color: #fff;
49+
font-family: BarlowCondensed, sans-serif;
50+
font-size: 31px;
51+
letter-spacing: 0.2px;
52+
text-transform: uppercase;
53+
font-weight: 500;
54+
55+
@include xs-to-sm {
56+
max-width: 350px;
57+
flex: 1;
58+
margin-right: 20px;
59+
font-size: 21px;
60+
}
61+
}
62+
63+
.toggle-arrow,
64+
.toggle-arrow-active {
65+
background-image: url(assets/images/minimal-down-white.svg);
66+
background-repeat: no-repeat;
67+
align-self: right;
68+
width: 24px;
69+
height: 15px;
70+
}
71+
72+
.toggle-arrow-active {
73+
transform: scale(1, -1);
74+
}

src/shared/components/Contentful/Dropdown/item.scss renamed to src/shared/components/Contentful/Dropdown/themes/item.scss

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,41 @@
55
width: 100%;
66
}
77

8-
.question {
8+
.question,
9+
.question-active {
910
display: flex;
1011
align-items: center;
1112
justify-content: space-between;
1213
height: 82px;
1314
outline: none;
1415
cursor: pointer;
1516
border-bottom: 1px solid #d4d4d4;
17+
}
1618

17-
&.active {
18-
border-bottom: none;
19-
}
19+
.question-active {
20+
border-bottom: none;
21+
height: 81px;
2022
}
2123

22-
.answer {
24+
.answer,
25+
.answer-active {
2326
@include gui-kit-content;
2427
@include gui-kit-headers;
2528

2629
display: none;
2730
padding: 5px 70px 24px 0;
2831
color: #2a2a2a;
2932

30-
&.active {
31-
display: block;
32-
border-bottom: 1px solid #d4d4d4;
33+
@include xs-to-sm {
34+
padding-right: 0;
3335
}
3436
}
3537

38+
.answer-active {
39+
display: block;
40+
border-bottom: 1px solid #d4d4d4;
41+
}
42+
3643
.text {
3744
color: #2a2a2a;
3845
font-family: BarlowCondensed, sans-serif;
@@ -43,17 +50,21 @@
4350

4451
@include xs-to-sm {
4552
max-width: 350px;
53+
flex: 1;
54+
margin-right: 20px;
55+
font-size: 21px;
4656
}
4757
}
4858

49-
.toggle-arrow {
59+
.toggle-arrow,
60+
.toggle-arrow-active {
5061
background-image: url(assets/images/minimal-down.svg);
5162
background-repeat: no-repeat;
5263
align-self: right;
5364
width: 24px;
5465
height: 13px;
66+
}
5567

56-
&.active {
57-
transform: scale(1, -1);
58-
}
68+
.toggle-arrow-active {
69+
transform: scale(1, -1);
5970
}

src/shared/components/Settings/Preferences/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default class Preferences extends React.Component {
8888
case 'e-mail':
8989
return <NewsletterPreferencesContainer email={email} />;
9090
case 'forum':
91-
return (window.location.href = `${config.URL.FORUMS}/?module=Settings`) && <LoadingIndicator />;
91+
return (window.location.href = `${config.URL.FORUMS_VANILLA}/profile/preferences`) && <LoadingIndicator />;
9292
case 'payment':
9393
return (window.location.href = `${config.URL.COMMUNITY}/tc?module=EditPaymentPreferences`) && <LoadingIndicator />;
9494
default:

src/shared/components/challenge-detail/Specification/SideBar/index.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,16 @@ export default function SideBar({
432432
</div>
433433
</Tooltip>
434434
</span>
435+
<span styleName="link-like-paragraph tooltip-container">
436+
<a
437+
href={config.URL.INFO.TEMPLATES_REPO}
438+
title="Topcoder Templates repository"
439+
target="_blank"
440+
rel="noreferrer"
441+
>
442+
Topcoder Templates <br /> repository
443+
</a>
444+
</span>
435445
</div>
436446
{ shareable && (
437447
<div>

0 commit comments

Comments
 (0)