Skip to content

Commit d9affe6

Browse files
Merge pull request #5891 from topcoder-platform/thrive-spooky1-4
Thrive spooky1 4
2 parents 3a66e07 + 45ea57f commit d9affe6

File tree

5 files changed

+45
-5
lines changed

5 files changed

+45
-5
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ workflows:
363363
filters:
364364
branches:
365365
only:
366-
- referral-lock
366+
- free
367367
# This is stage env for production QA releases
368368
- "build-prod-staging":
369369
context : org-global

src/shared/components/Contentful/Article/Article.jsx

+17-1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,17 @@ class Article extends React.Component {
148148
},
149149
).substring(0, CONTENT_PREVIEW_LENGTH);
150150
const catsGrouped = _.groupBy(fields.contentCategory, cat => cat.fields.trackParent);
151+
// captures clicks on article
152+
// for opening external links in new tab
153+
const articleClickHandler = (e) => {
154+
if (e.target.href && fields.openExternalLinksInNewTab !== false) {
155+
const target = new URL(e.target.href);
156+
if (!target.host.includes('topcoder')) {
157+
window.open(e.target.href, '_blank');
158+
e.preventDefault();
159+
}
160+
}
161+
};
151162

152163
return (
153164
<React.Fragment>
@@ -291,7 +302,12 @@ class Article extends React.Component {
291302
</div>
292303
</div>
293304
{/* Content */}
294-
<div className={theme.articleContent}>
305+
<div
306+
className={theme.articleContent}
307+
role="presentation"
308+
onClick={articleClickHandler}
309+
onKeyPress={articleClickHandler}
310+
>
295311
<MarkdownRenderer markdown={fields.content} {...contentfulConfig} />
296312
{
297313
fields.type === 'Video' && fields.contentUrl ? (

src/shared/components/Contentful/Article/themes/default.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@
324324
ol {
325325
@include tc-body-md;
326326

327-
padding-left: 20px;
327+
padding-left: 30px;
328328
margin-bottom: 20px;
329329

330330
@include roboto-regular;
@@ -485,6 +485,10 @@
485485
margin-bottom: 108px;
486486
}
487487

488+
@media screen and (min-width: 1440px) and (max-width: 1900px) {
489+
margin-bottom: 70px;
490+
}
491+
488492
@media screen and (max-width: 768px) {
489493
margin-bottom: 300px;
490494
}

src/shared/components/Contentful/ArticleCard/themes/article_large.scss

+20
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
@include xs-to-sm {
1313
margin: 5px;
1414
}
15+
16+
@media screen and (max-width: 425px) {
17+
max-height: none;
18+
}
1519
}
1620

1721
.contentWrapper {
@@ -23,6 +27,10 @@
2327
display: flex;
2428
flex-direction: row;
2529
align-items: stretch;
30+
31+
@media screen and (max-width: 425px) {
32+
flex-direction: column;
33+
}
2634
}
2735

2836
.main {
@@ -225,6 +233,11 @@
225233
min-width: 150px;
226234
}
227235

236+
@media screen and (max-width: 425px) {
237+
width: 100%;
238+
min-height: 130px;
239+
}
240+
228241
&::before {
229242
content: '';
230243
width: 35px;
@@ -234,5 +247,12 @@
234247
background-size: cover;
235248
background-position: right -2px;
236249
position: absolute;
250+
251+
@media screen and (max-width: 425px) {
252+
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 290 31.73' style='enable-background:new 0 0 290 31.73;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill-rule:evenodd;clip-rule:evenodd;fill:%23F4F4F4;%7D%0A%3C/style%3E%3Cg id='Thrive'%3E%3Cg id='Artboard' transform='translate(-22.000000, -20.000000)'%3E%3Cg id='Combined-Shape'%3E%3Cpath class='st0' d='M22,20h290l0,24.11c-60.39,13.64-90.73-0.4-142.15-10.48C118.1,23.5,97,79,22.08,33.64l0,0l0,1.34'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
253+
width: 100%;
254+
height: 33px;
255+
background-position: 0 -10px;
256+
}
237257
}
238258
}

src/shared/components/Contentful/SearchBar/SearchBar.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class SearchBarInner extends Component {
7474

7575
onKeyDown(e) {
7676
const { inputlVal, selectedFilter } = this.state;
77-
if (inputlVal && e.which === 13) {
77+
if (_.trim(inputlVal) && e.which === 13) {
7878
const searchQuery = {};
7979
if (this.searchFieldRef && this.searchFieldRef.value) {
8080
if (selectedFilter.name === 'Tags') {
@@ -90,7 +90,7 @@ export class SearchBarInner extends Component {
9090
if (selectedFilter.name !== 'Author') {
9191
window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?${qs.stringify(searchQuery)}`;
9292
} else {
93-
window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?author=${inputlVal}`;
93+
window.location.href = `${config.TC_EDU_BASE_PATH}${config.TC_EDU_SEARCH_PATH}?author=${_.trim(inputlVal)}`;
9494
}
9595
}
9696
}

0 commit comments

Comments
 (0)