Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7085fa1

Browse files
committedMay 20, 2024·
TOP-1390 fix lint errors
1 parent 77a9279 commit 7085fa1

File tree

5 files changed

+60
-56
lines changed

5 files changed

+60
-56
lines changed
 

‎src/shared/components/Dashboard/BlogFeed/index.jsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
* Blog Feed component
33
*/
44

5-
import LoadingIndicator from "components/LoadingIndicator";
6-
import PT from "prop-types";
7-
import React from "react";
8-
import "./styles.scss";
9-
import { config } from "topcoder-react-utils";
5+
import LoadingIndicator from 'components/LoadingIndicator';
6+
import PT from 'prop-types';
7+
import React from 'react';
8+
import './styles.scss';
9+
import { config } from 'topcoder-react-utils';
1010

1111
export default function BlogFeed({ blogs, loading, theme }) {
1212
return (
@@ -30,9 +30,16 @@ export default function BlogFeed({ blogs, loading, theme }) {
3030
<LoadingIndicator />
3131
</div>
3232
) : (
33-
blogs.map((blog) => (
34-
<div styleName="row" key={`blog-feed-${blog.link}`}>
35-
<a href={`${blog.link}`} target="_blank" rel="noreferrer">
33+
blogs.map(blog => (
34+
<div
35+
styleName="row"
36+
key={`blog-feed-${blog.link}`}
37+
>
38+
<a
39+
href={`${blog.link}`}
40+
target="_blank"
41+
rel="noreferrer"
42+
>
3643
{blog.title}
3744
</a>
3845
</div>
@@ -45,11 +52,11 @@ export default function BlogFeed({ blogs, loading, theme }) {
4552

4653
BlogFeed.defaultProps = {
4754
blogs: [],
48-
theme: "light",
55+
theme: 'light',
4956
};
5057

5158
BlogFeed.propTypes = {
5259
blogs: PT.arrayOf(PT.shape()),
5360
loading: PT.bool.isRequired,
54-
theme: PT.oneOf(["dark", "light"]),
61+
theme: PT.oneOf(['dark', 'light']),
5562
};

‎src/shared/components/Dashboard/Challenges/index.jsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import _ from "lodash";
2-
import LoadingIndicator from "components/LoadingIndicator";
3-
import PT from "prop-types";
4-
import React from "react";
5-
import qs from "qs";
1+
import _ from 'lodash';
2+
import LoadingIndicator from 'components/LoadingIndicator';
3+
import PT from 'prop-types';
4+
import React from 'react';
5+
import qs from 'qs';
66

7-
import { config } from "topcoder-react-utils";
7+
import { config } from 'topcoder-react-utils';
88

9-
import "./styles.scss";
9+
import './styles.scss';
1010

1111
export default function ChallengesFeed({
1212
challenges,
@@ -24,7 +24,7 @@ export default function ChallengesFeed({
2424
href={`${config.URL.CHALLENGES_URL}${
2525
challengeListingQuery
2626
? `?${qs.stringify(challengeListingQuery)}`
27-
: ""
27+
: ''
2828
}`}
2929
target="_blank"
3030
rel="noreferrer"
@@ -38,7 +38,7 @@ export default function ChallengesFeed({
3838
<LoadingIndicator />
3939
</div>
4040
) : (
41-
(challenges || []).map((challenge) => (
41+
(challenges || []).map(challenge => (
4242
<div styleName="row" key={challenge.id}>
4343
<a
4444
href={`/challenges/${challenge.id}`}
@@ -51,10 +51,8 @@ export default function ChallengesFeed({
5151
<span styleName="amount">
5252
{`$${_.sum(
5353
challenge.prizeSets
54-
.filter((set) => set.type === "placement")
55-
.map((item) =>
56-
_.sum(item.prizes.map((prize) => prize.value))
57-
)
54+
.filter(set => set.type === 'placement')
55+
.map(item => _.sum(item.prizes.map(prize => prize.value))),
5856
).toLocaleString()}`}
5957
</span>
6058
</div>
@@ -68,15 +66,15 @@ export default function ChallengesFeed({
6866

6967
ChallengesFeed.defaultProps = {
7068
challenges: [],
71-
theme: "light",
72-
title: "Opportunities",
69+
theme: 'light',
70+
title: 'Opportunities',
7371
challengeListingQuery: undefined,
7472
};
7573

7674
ChallengesFeed.propTypes = {
7775
challenges: PT.arrayOf(PT.shape()),
7876
loading: PT.bool.isRequired,
79-
theme: PT.oneOf(["dark", "light"]),
77+
theme: PT.oneOf(['dark', 'light']),
8078
title: PT.string,
8179
challengeListingQuery: PT.shape(),
8280
};

‎src/shared/components/Dashboard/TCTime/index.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**
22
* Topcoder Time Component
33
*/
4-
import React, { useState, useEffect } from "react";
5-
import moment from "moment-timezone";
6-
import darkTheme from "./dark.scss";
7-
import lightTheme from "./light.scss";
4+
import React, { useState, useEffect } from 'react';
5+
import moment from 'moment-timezone';
6+
import darkTheme from './dark.scss';
7+
import lightTheme from './light.scss';
88

99
const THEMES = {
1010
dark: darkTheme,
@@ -13,8 +13,8 @@ const THEMES = {
1313

1414
function TopcoderTime() {
1515
const theme = THEMES.light;
16-
let FORMAT = "MMM Do, HH:mm UTC";
17-
const TIMEZONE = "America/New_York";
16+
let FORMAT = 'MMM Do, HH:mm UTC';
17+
const TIMEZONE = 'America/New_York';
1818
const now = moment.tz(new Date(), TIMEZONE);
1919
FORMAT += now.utcOffset() / 60;
2020
const [tcTime, setTCTime] = useState(`${now.format(FORMAT)}`);

‎src/shared/components/Dashboard/ThriveArticlesFeed/index.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* Thrive Articles Feed component
33
*/
44

5-
import LoadingIndicator from "components/LoadingIndicator";
6-
import PT from "prop-types";
7-
import React from "react";
8-
import "./styles.scss";
5+
import LoadingIndicator from 'components/LoadingIndicator';
6+
import PT from 'prop-types';
7+
import React from 'react';
8+
import './styles.scss';
99

1010
export default function ThriveArticlesFeed({ articles, loading, theme }) {
1111
return (
@@ -24,7 +24,7 @@ export default function ThriveArticlesFeed({ articles, loading, theme }) {
2424
<LoadingIndicator />
2525
</div>
2626
) : (
27-
articles.map((article) => (
27+
articles.map(article => (
2828
<div
2929
styleName="row"
3030
key={`thrive-articles-feed-${article.fields.slug}`}
@@ -48,11 +48,11 @@ export default function ThriveArticlesFeed({ articles, loading, theme }) {
4848

4949
ThriveArticlesFeed.defaultProps = {
5050
articles: [],
51-
theme: "light",
51+
theme: 'light',
5252
};
5353

5454
ThriveArticlesFeed.propTypes = {
5555
articles: PT.arrayOf(PT.shape()),
5656
loading: PT.bool.isRequired,
57-
theme: PT.oneOf(["dark", "light"]),
57+
theme: PT.oneOf(['dark', 'light']),
5858
};

‎src/shared/containers/Dashboard/index.jsx

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
/**
66
* SlashTC index container
77
*/
8-
import React, { useEffect } from "react";
9-
import PT from "prop-types";
10-
import { connect } from "react-redux";
11-
import { useMediaQuery } from "react-responsive";
12-
import { isTokenExpired } from "@topcoder-platform/tc-auth-lib";
13-
import { config } from "topcoder-react-utils";
14-
import Viewport from "components/Contentful/Viewport";
15-
import TopcoderTime from "components/Dashboard/TCTime";
16-
import ThriveArticlesFeedContainer from "containers/Dashboard/ThriveArticlesFeed";
8+
import React, { useEffect } from 'react';
9+
import PT from 'prop-types';
10+
import { connect } from 'react-redux';
11+
import { useMediaQuery } from 'react-responsive';
12+
import { isTokenExpired } from '@topcoder-platform/tc-auth-lib';
13+
import { config } from 'topcoder-react-utils';
14+
import Viewport from 'components/Contentful/Viewport';
15+
import TopcoderTime from 'components/Dashboard/TCTime';
16+
import ThriveArticlesFeedContainer from 'containers/Dashboard/ThriveArticlesFeed';
1717
// deprecated with https://topcoder.atlassian.net/browse/CORE-346
1818
// import GigsFeed from 'containers/Dashboard/GigsFeed';
19-
import ChallengesFeed from "containers/Dashboard/ChallengesFeed";
20-
import BlogFeedContainer from "containers/Dashboard/BlogFeed";
21-
import MetaTags from "components/MetaTags";
19+
import ChallengesFeed from 'containers/Dashboard/ChallengesFeed';
20+
import BlogFeedContainer from 'containers/Dashboard/BlogFeed';
21+
import MetaTags from 'components/MetaTags';
2222
// deprecated with https://topcoder.atlassian.net/browse/TOP-1390
2323
// import NewsFeed from './NewsFeed';
24-
import darkTheme from "./themes/dark.scss";
25-
import lightTheme from "./themes/light.scss";
24+
import darkTheme from './themes/dark.scss';
25+
import lightTheme from './themes/light.scss';
2626

2727
const THEMES = {
2828
dark: darkTheme,
@@ -33,7 +33,7 @@ const { INNOVATION_CHALLENGES_TAG } = config;
3333
function SlashTCContainer(props) {
3434
const theme = THEMES.light;
3535
const isTabletOrMobile = useMediaQuery({ maxWidth: 768 });
36-
const title = "Home | Topcoder";
36+
const title = 'Home | Topcoder';
3737
const challengeListingQuery = {
3838
search: INNOVATION_CHALLENGES_TAG,
3939
isInnovationChallenge: true,
@@ -129,8 +129,7 @@ SlashTCContainer.propTypes = {
129129
};
130130

131131
function mapStateToProps(state) {
132-
const profile =
133-
state.auth && state.auth.profile ? { ...state.auth.profile } : {};
132+
const profile = state.auth && state.auth.profile ? { ...state.auth.profile } : {};
134133
return {
135134
profile,
136135
tokenV3: state.auth.tokenV3,

0 commit comments

Comments
 (0)
Please sign in to comment.