Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit c865971

Browse files
Merge pull request #93 from topcoder-platform/bugbash
Welcome banner and feedback button
2 parents d60e817 + 429d066 commit c865971

File tree

9 files changed

+210
-16
lines changed

9 files changed

+210
-16
lines changed

src/App.jsx

+16-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
* Main App component
33
*/
44
import React, { useState, useLayoutEffect, useEffect, useRef } from "react";
5-
import { Router, useLocation } from "@reach/router";
5+
import { Router, useLocation, redirectTo } from "@reach/router";
66
import Challenges from "./containers/Challenges";
77
import Filter from "./containers/Filter";
88
import Menu from "./components/Menu";
99
import { disableSidebarForRoute } from "@topcoder/micro-frontends-navbar-app";
10-
import NoSidebarDemo from "./components/NoSidebarDemo";
10+
import Button from "./components/Button";
1111
import * as constants from "./constants";
1212
import actions from "./actions";
1313
import * as utils from "./utils";
@@ -84,9 +84,20 @@ const App = () => {
8484
return (
8585
<div className="layout">
8686
<aside className="sidebar">
87-
{menu}
88-
<hr />
89-
<Filter />
87+
<div className="sidebar-content">
88+
{menu}
89+
<hr />
90+
<Filter />
91+
</div>
92+
<div className="sidebar-footer">
93+
<a
94+
className="button button-primary"
95+
href="https://github.com/topcoder-platform/micro-frontends-earn-app/issues/new?assignees=&labels=&template=bug_report.md&title="
96+
target="_blank"
97+
>
98+
GIVE APPLICATION FEEDBACK
99+
</a>
100+
</div>
90101
</aside>
91102
<div className="content">
92103
<Router>
+17
Loading

src/components/Banner/index.jsx

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import React, { useState } from "react";
2+
import PT from "prop-types";
3+
import BannerChevronUp from "../../assets/icons/banner-chevron-up.svg";
4+
5+
import "./styles.scss";
6+
7+
const Banner = () => {
8+
const [isExpanded, setIsExpanded] = useState(false);
9+
const header =
10+
"Welcome to our BETA work listings site - Tell us what you think!";
11+
12+
return (
13+
<div styleName="banner">
14+
<p styleName="header">
15+
{header}
16+
17+
<span
18+
styleName={`chevron ${isExpanded ? "" : "expanded"}`}
19+
role="button"
20+
tabIndex="0"
21+
onClick={() => setIsExpanded(!isExpanded)}
22+
>
23+
<BannerChevronUp />
24+
</span>
25+
</p>
26+
27+
{isExpanded && (
28+
<div styleName="content">
29+
<p>
30+
Welcome to the Beta version of the new Challenge Listings. During
31+
this Beta phase, we will be fine-tuning the platform based on
32+
feedback we receive from you, our community members.
33+
</p>
34+
<h3>NOTE THAT THIS IS NOT THE FINAL VERSION OF THE SITE.</h3>
35+
<p>
36+
You may encounter occasional broken links or error messages. If so,
37+
please let us know! This is what the Beta phase is intended for, and
38+
your feedback will enable us to greatly improve the new site.{" "}
39+
</p>
40+
<p>
41+
You can click on the Feedback button on page or file a github ticket
42+
at{" "}
43+
<a href="http://https://github.com/topcoder-platform/micro-frontends-earn-app/issues/new">
44+
https://github.com/topcoder-platform/micro-frontends-earn-app/issues/new
45+
</a>
46+
.
47+
</p>
48+
<p>Thank you!</p>
49+
</div>
50+
)}
51+
</div>
52+
);
53+
};
54+
55+
Banner.propTypes = {};
56+
57+
export default Banner;

src/components/Banner/styles.scss

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
@import "styles/variables";
2+
@import "styles/mixins";
3+
@import "styles/GUIKit/default";
4+
5+
.banner {
6+
display: flex;
7+
justify-content: flex-start;
8+
flex-wrap: wrap;
9+
10+
width: 100%;
11+
background: linear-gradient(90deg, $blue 0%, $lightGreen2 100%);
12+
border-radius: 10px;
13+
margin-bottom: 22px;
14+
color: $white;
15+
padding-left: 28px;
16+
17+
.header {
18+
display: flex;
19+
width: 100%;
20+
justify-content: space-between;
21+
flex-direction: row;
22+
align-items: center;
23+
@include roboto-bold;
24+
height: 50px;
25+
font-size: 20px;
26+
text-transform: uppercase;
27+
}
28+
29+
.chevron {
30+
margin-right: 20px;
31+
margin-top: 5px;
32+
33+
&.expanded {
34+
transform: rotate(180deg);
35+
}
36+
37+
&:hover {
38+
cursor: pointer;
39+
}
40+
}
41+
42+
.content {
43+
display: flex;
44+
flex-direction: column;
45+
justify-content: flex-start;
46+
font-size: 16px;
47+
margin-bottom: 24px;
48+
width: 85%;
49+
50+
h3 {
51+
font-size: 15px;
52+
font-weight: bold;
53+
margin-top: 15px;
54+
}
55+
56+
p {
57+
margin-top: 15px;
58+
}
59+
60+
a {
61+
text-decoration: underline;
62+
}
63+
64+
}
65+
}

src/components/Button/index.jsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,23 @@ import PT from "prop-types";
33

44
import "./styles.scss";
55

6-
const Button = ({ children, onClick }) => (
7-
<button styleName="button" onClick={onClick}>
6+
const Button = ({ children, onClick, primary }) => (
7+
<button
8+
styleName={`${primary ? "button button-primary" : "button"}`}
9+
onClick={onClick}
10+
>
811
{children}
912
</button>
1013
);
1114

15+
Button.defaultProps = {
16+
primary: false,
17+
};
18+
1219
Button.propTypes = {
1320
children: PT.node,
1421
onClick: PT.func,
22+
primary: PT.bool,
1523
};
1624

1725
export default Button;

src/containers/Challenges/Listing/ChallengeItem/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const ChallengeItem = ({ challenge, onClickTag, onClickTrack, isLoggedIn }) => {
2424
challenge.prizeSets
2525
);
2626

27-
let submissionLink = `${process.env.URL.BASE}/challenges/${challenge.id}`;
27+
let submissionLink = `${process.env.URL.BASE}/challenges/${challenge.id}`; // eslint-disable-line no-undef
2828

2929
if (isLoggedIn && challenge.numOfSubmissions > 0) {
3030
submissionLink += "?tab=submissions";

src/containers/Challenges/index.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import IconListView from "../../assets/icons/list-view.svg";
1010
import IconCardView from "../../assets/icons/card-view.svg";
1111

1212
import "./styles.scss";
13+
import Banner from "../../components/Banner";
1314

1415
const Challenges = ({
1516
challenges,
@@ -56,6 +57,7 @@ const Challenges = ({
5657

5758
return (
5859
<div styleName="page">
60+
<Banner />
5961
<h1 styleName="title">
6062
<span>CHALLENGES</span>
6163
<span styleName="view-mode">

src/styles/_utils.scss

+35-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,47 @@
66
flex: 0 0 270px;
77
min-height: calc(100vh - 60px);
88
background: $white;
9+
display: flex;
10+
flex-direction: column;
11+
justify-content: space-between;
912

10-
> hr {
11-
margin: 0 20px;
12-
border-color: $tc-gray-05;
13-
opacity: 0.5;
13+
.sidebar-content {
14+
> hr {
15+
margin: 0 20px;
16+
border-color: $tc-gray-05;
17+
opacity: 0.5;
18+
}
19+
20+
}
21+
22+
.sidebar-footer {
23+
margin: 0 auto;
24+
margin-bottom: 125px;
1425
}
1526
}
1627

1728
.content {
1829
flex: 1 1 auto;
1930
}
31+
32+
.button {
33+
@include roboto-bold;
34+
35+
padding: 12px 16px;
36+
font-size: 13px;
37+
color: $green;
38+
line-height: 1;
39+
letter-spacing: 0.8px;
40+
white-space: nowrap;
41+
appearance: none;
42+
background: $white;
43+
border: 1px solid $green2;
44+
border-radius: 20px;
45+
}
46+
47+
.button-primary {
48+
color: $white;
49+
background-color: $green2;
50+
}
2051
}
2152
}

src/styles/_variables.scss

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* The standard TC UI pallete. Always prefer to use these constants to set
55
* colors in your stylesheets.
66
*/
7-
/* Grayscale colors. */
7+
/* Grayscale colors. */
88
$tc-black: #151516;
99
$tc-gray-90: #2a2a2b;
1010
$tc-gray-80: #404041;
@@ -97,7 +97,7 @@ $tc-pastel-blue: #5656f4;
9797
$tc-pastel-yellow: #feb900;
9898
$tc-pastel-crimson: #e90c5a;
9999

100-
/* Color aliases. */
100+
/* Color aliases. */
101101

102102
/* Base metal colors. */
103103
$tc-gold: $tc-gold-100;
@@ -132,8 +132,11 @@ $base-unit: 5px;
132132
$body-color: $tc-gray-90;
133133
$white: $tc-white;
134134
$green: #229174;
135-
$darkGreen: #137D60;
135+
$green2: #287d61;
136+
$darkGreen: #137d60;
136137
$lightGreen: #0ab88a;
138+
$lightGreen2: #06d6a0;
139+
$blue: #2c95d7;
137140

138141
$border-radius: 6px;
139142
$border-radius-sm: 5px;
@@ -142,4 +145,4 @@ $border-radius-lg: 8px;
142145
$page-padding-x: 7 * $base-unit;
143146
$page-padding-y: 32px;
144147

145-
$screen-xxl: 1366px;
148+
$screen-xxl: 1366px;

0 commit comments

Comments
 (0)