Skip to content

Commit 57dc78b

Browse files
committed
Some fixes of Blockchain community routing
+ preparing to hide the challenge listing when visitor is not a member of community (but this is not finished yet).
1 parent 8b409fe commit 57dc78b

File tree

5 files changed

+65
-4
lines changed

5 files changed

+65
-4
lines changed
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Head banner for challenge listing page in Blockchain community.
3+
*/
4+
5+
import Banner from 'components/tc-communities/Banner';
6+
import React from 'react';
7+
import style from './style.scss';
8+
9+
export default function TopBanner() {
10+
return (
11+
<Banner
12+
title="Challenges"
13+
text="Browse our available challenges and compete."
14+
theme={{
15+
container: style.bannerContainer,
16+
content: style.bannerContent,
17+
contentInner: style.bannerContentInner,
18+
}}
19+
imageSrc="/themes/blockchain/challenges/banner.jpg"
20+
/>
21+
);
22+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@import "~styles/mixins";
2+
3+
.bannerContainer {
4+
height: 252px !important;
5+
6+
@include xxs-to-xs {
7+
height: 300px !important;
8+
}
9+
}
10+
11+
.bannerContent {
12+
bottom: 0 !important;
13+
top: 0 !important;
14+
transform: none !important;
15+
width: 600px !important;
16+
17+
@include xxs-to-xs {
18+
top: auto !important;
19+
width: 100% !important;
20+
}
21+
}
22+
23+
.bannerContentInner {
24+
@include xxs-to-xs {
25+
padding-bottom: 20px !important;
26+
padding-top: 48px !important;
27+
}
28+
}

src/shared/routes/Communities/Blockchain/Routes.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
* Routing of Wipro Community.
33
*/
44

5+
import ChallengeListingTopBanner from
6+
'components/tc-communities/communities/blockchain/ChallengeListing/TopBanner';
57
import Error404 from 'components/Error404';
6-
import Footer from 'components/tc-communities/communities/wipro/Footer';
8+
import Footer from 'containers/tc-communities/Footer';
79
import Header from 'containers/tc-communities/Header';
8-
import Home from 'components/tc-communities/communities/qa/Home';
9-
import Learn from 'components/tc-communities/communities/qa/Learn';
10+
import Home from 'components/tc-communities/communities/blockchain/Home';
11+
import Learn from 'components/tc-communities/communities/blockchain/Learn';
1012
import PT from 'prop-types';
1113
import React from 'react';
1214
import { Route, Switch } from 'react-router-dom';
@@ -22,7 +24,12 @@ export default function Routes({ base, meta }) {
2224
<Header pageId={match.params.pageId || 'home'} />
2325
<Switch>
2426
<Route
25-
component={() => <ChallengeListing meta={meta} />}
27+
component={() => (
28+
<div>
29+
<ChallengeListingTopBanner />
30+
<ChallengeListing listingOnly meta={meta} />
31+
</div>
32+
)}
2633
exact
2734
path={`${base}/challenges`}
2835
/>

src/shared/routes/Communities/ChallengeListing.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { SplitRoute } from 'utils/router';
1111

1212
export default function ChallengeListingRoute({
1313
challengesUrl,
14+
listingOnly,
1415
meta,
1516
newChallengeDetails,
1617
}) {
@@ -39,6 +40,7 @@ export default function ChallengeListingRoute({
3940
* should be adopted. */
4041
hideTcLinksInSidebarFooter={meta.communityId === 'wipro'}
4142

43+
listingOnly={listingOnly}
4244
newChallengeDetails={newChallengeDetails}
4345
openChallengesInNewTabs={
4446
_.get(meta, 'challengeListing.openChallengesInNewTabs')
@@ -55,11 +57,13 @@ export default function ChallengeListingRoute({
5557

5658
ChallengeListingRoute.defaultProps = {
5759
challengesUrl: '/challenges',
60+
listingOnly: false,
5861
newChallengeDetails: false,
5962
};
6063

6164
ChallengeListingRoute.propTypes = {
6265
challengesUrl: PT.string,
66+
listingOnly: PT.bool,
6367
meta: PT.shape({
6468
challengeListing: PT.shape({
6569
openChallengesInNewTabs: PT.bool,

0 commit comments

Comments
 (0)