Skip to content

Commit

Permalink
Merge pull request #5464 from topcoder-platform/develop
Browse files Browse the repository at this point in the history
Release 2021/04/05 (v1.8.4)
  • Loading branch information
luizrrodrigues authored Apr 2, 2021
2 parents e64cd49 + 61a254c commit 33936b3
Show file tree
Hide file tree
Showing 12 changed files with 189 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,21 +283,21 @@ workflows:
filters:
branches:
only:
- gig-application-update
- FAQ-theme
# This is alternate dev env for parallel testing
- "build-qa":
context : org-global
filters:
branches:
only:
- free
- bug-bash
# This is beta env for production soft releases
- "build-prod-beta":
context : org-global
filters:
branches:
only:
- develop
- bug-bash
# This is stage env for production QA releases
- "build-prod-staging":
context : org-global
Expand Down
1 change: 1 addition & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ module.exports = {
HOWTOCOMPETEINMARATHON: 'https://www.topcoder.com/thrive/articles/How%20To%20Compete%20in%20a%20Marathon%20Match',
USABLECODEDEV: 'https://www.topcoder.com/thrive/articles/Usable%20Code%20in%20Dev%20Challenges',
EXTENSIONVSCODE: 'https://marketplace.visualstudio.com/items?itemName=Topcoder.topcoder-workflow&ssr=false#overview',
TEMPLATES_REPO: 'https://github.com/topcoder-platform-templates',
},

IOS: 'https://ios.topcoder-dev.com',
Expand Down
19 changes: 19 additions & 0 deletions src/assets/images/minimal-down-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 16 additions & 9 deletions src/shared/components/Contentful/Dropdown/DropdownItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
import React from 'react';
import PT from 'prop-types';
import MarkdownRenderer from 'components/MarkdownRenderer';
import { themr } from 'react-css-super-themr';
import defaultTheme from './themes/item.scss';
import darkTheme from './themes/item-dark.scss';

import './item.scss';

const THEMES = {
Default: defaultTheme,
'Dark mode': darkTheme,
};
class DropdownItem extends React.Component {
constructor(props) {
super(props);
Expand All @@ -24,24 +29,24 @@ class DropdownItem extends React.Component {
}

render() {
const { data } = this.props;
const { data, baseTheme } = this.props;
const { isActive } = this.state;
return (
<div styleName="container" id={data.sys.id}>
<div className={THEMES[baseTheme].container} id={data.sys.id}>
<div
tabIndex={0}
role="button"
onKeyPress={e => (e.key === 'Enter' ? null : null)}
styleName={isActive ? 'question active' : 'question'}
className={isActive ? THEMES[baseTheme]['question-active'] : THEMES[baseTheme].question}
onClick={() => this.toggleActive()}
>
<div styleName="text">
<div className={THEMES[baseTheme].text}>
{data.fields.title}
</div>
<div styleName={isActive ? 'toggle-arrow active' : 'toggle-arrow'} />
<div className={isActive ? THEMES[baseTheme]['toggle-arrow-active'] : THEMES[baseTheme]['toggle-arrow']} />
</div>
<div
styleName={isActive ? 'answer active' : 'answer'}
className={isActive ? THEMES[baseTheme]['answer-active'] : THEMES[baseTheme].answer}
>
<MarkdownRenderer markdown={data.fields.text} {...this.props} />
</div>
Expand All @@ -55,6 +60,7 @@ DropdownItem.defaultProps = {
spaceName: null,
environment: null,
isActive: false,
baseTheme: 'Default',
};

DropdownItem.propTypes = {
Expand All @@ -63,6 +69,7 @@ DropdownItem.propTypes = {
preview: PT.bool,
spaceName: PT.string,
environment: PT.string,
baseTheme: PT.string,
};

export default DropdownItem;
export default themr('DropdownItem', defaultTheme)(DropdownItem);
18 changes: 15 additions & 3 deletions src/shared/components/Contentful/Dropdown/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@ import React from 'react';
import { fixStyle } from 'utils/contentful';
import DropdownItem from './DropdownItem';

import defaultTheme from './default.scss';
import defaultTheme from './themes/default.scss';
import darkTheme from './themes/dark.scss';

const THEMES = {
Default: defaultTheme,
'Dark mode': darkTheme,
};

function DropdownItemsLoader(props) {
const {
ids,
preview,
spaceName,
environment,
baseTheme,
} = props;

return (
Expand All @@ -34,6 +41,7 @@ function DropdownItemsLoader(props) {
spaceName={spaceName}
environment={environment}
key={item.sys.id}
baseTheme={baseTheme}
/>
))
)}
Expand All @@ -53,6 +61,7 @@ DropdownItemsLoader.propTypes = {
preview: PT.bool,
spaceName: PT.string,
environment: PT.string,
baseTheme: PT.string.isRequired,
};

/* Loads the dropdown entry. */
Expand All @@ -69,20 +78,23 @@ export default function DropdownLoader(props) {
render={(data) => {
const { fields } = Object.values(data.entries.items)[0];
if (!fields) return null;
let { theme } = fields;
theme = theme || 'Default';
return (
<div
className={defaultTheme.container}
className={THEMES[theme].container}
style={fixStyle(fields.extraStylesForContainer)}
>
<div
className={defaultTheme.contentWrapper}
className={THEMES[theme].contentWrapper}
style={fixStyle(fields.extraStylesForContentWrapper)}
>
<DropdownItemsLoader
ids={_.map(fields.items, 'sys.id')}
preview={preview}
spaceName={spaceName}
environment={environment}
baseTheme={theme}
/>
</div>
</div>
Expand Down
18 changes: 18 additions & 0 deletions src/shared/components/Contentful/Dropdown/themes/dark.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@import "~styles/mixins";

.container {
padding: 0;

@include xs-to-sm {
padding: 0 15px;
}
}

.contentWrapper {
display: flex;
margin: 0 auto;
max-width: $screen-md;
color: #fff;
flex-direction: column;
border-top: 1px solid rgba(212, 212, 212, 0.4);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
display: flex;
margin: 0 auto;
max-width: $screen-md;
color: black;
color: #2a2a2a;
flex-direction: column;
border-top: 1px solid #d4d4d4;
}
74 changes: 74 additions & 0 deletions src/shared/components/Contentful/Dropdown/themes/item-dark.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
@import "~styles/mixins";
@import "~components/Contentful/default";

.container {
width: 100%;
}

.question,
.question-active {
display: flex;
align-items: center;
justify-content: space-between;
height: 82px;
outline: none;
cursor: pointer;
border-bottom: 1px solid rgba(212, 212, 212, 0.4);
}

.question-active {
border-bottom: none;
height: 81px;
}

.answer,
.answer-active {
@include gui-kit-content;
@include gui-kit-headers;

display: none;
padding: 5px 70px 24px 0;
color: #fff;

@include xs-to-sm {
padding-right: 0;
}

p {
color: #fff;
}
}

.answer-active {
display: block;
border-bottom: 1px solid rgba(212, 212, 212, 0.4);
}

.text {
color: #fff;
font-family: BarlowCondensed, sans-serif;
font-size: 31px;
letter-spacing: 0.2px;
text-transform: uppercase;
font-weight: 500;

@include xs-to-sm {
max-width: 350px;
flex: 1;
margin-right: 20px;
font-size: 21px;
}
}

.toggle-arrow,
.toggle-arrow-active {
background-image: url(assets/images/minimal-down-white.svg);
background-repeat: no-repeat;
align-self: right;
width: 24px;
height: 15px;
}

.toggle-arrow-active {
transform: scale(1, -1);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,41 @@
width: 100%;
}

.question {
.question,
.question-active {
display: flex;
align-items: center;
justify-content: space-between;
height: 82px;
outline: none;
cursor: pointer;
border-bottom: 1px solid #d4d4d4;
}

&.active {
border-bottom: none;
}
.question-active {
border-bottom: none;
height: 81px;
}

.answer {
.answer,
.answer-active {
@include gui-kit-content;
@include gui-kit-headers;

display: none;
padding: 5px 70px 24px 0;
color: #2a2a2a;

&.active {
display: block;
border-bottom: 1px solid #d4d4d4;
@include xs-to-sm {
padding-right: 0;
}
}

.answer-active {
display: block;
border-bottom: 1px solid #d4d4d4;
}

.text {
color: #2a2a2a;
font-family: BarlowCondensed, sans-serif;
Expand All @@ -43,17 +50,21 @@

@include xs-to-sm {
max-width: 350px;
flex: 1;
margin-right: 20px;
font-size: 21px;
}
}

.toggle-arrow {
.toggle-arrow,
.toggle-arrow-active {
background-image: url(assets/images/minimal-down.svg);
background-repeat: no-repeat;
align-self: right;
width: 24px;
height: 13px;
}

&.active {
transform: scale(1, -1);
}
.toggle-arrow-active {
transform: scale(1, -1);
}
2 changes: 1 addition & 1 deletion src/shared/components/Settings/Preferences/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class Preferences extends React.Component {
case 'e-mail':
return <NewsletterPreferencesContainer email={email} />;
case 'forum':
return (window.location.href = `${config.URL.FORUMS}/?module=Settings`) && <LoadingIndicator />;
return (window.location.href = `${config.URL.FORUMS_VANILLA}/profile/preferences`) && <LoadingIndicator />;
case 'payment':
return (window.location.href = `${config.URL.COMMUNITY}/tc?module=EditPaymentPreferences`) && <LoadingIndicator />;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,16 @@ export default function SideBar({
</div>
</Tooltip>
</span>
<span styleName="link-like-paragraph tooltip-container">
<a
href={config.URL.INFO.TEMPLATES_REPO}
title="Topcoder Templates repository"
target="_blank"
rel="noreferrer"
>
Topcoder Templates <br /> repository
</a>
</span>
</div>
{ shareable && (
<div>
Expand Down
Loading

0 comments on commit 33936b3

Please sign in to comment.