Skip to content

Commit

Permalink
TOP-1390 fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kkartunov committed May 20, 2024
1 parent 77a9279 commit 7085fa1
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 56 deletions.
27 changes: 17 additions & 10 deletions src/shared/components/Dashboard/BlogFeed/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* Blog Feed component
*/

import LoadingIndicator from "components/LoadingIndicator";
import PT from "prop-types";
import React from "react";
import "./styles.scss";
import { config } from "topcoder-react-utils";
import LoadingIndicator from 'components/LoadingIndicator';
import PT from 'prop-types';
import React from 'react';
import './styles.scss';
import { config } from 'topcoder-react-utils';

export default function BlogFeed({ blogs, loading, theme }) {
return (
Expand All @@ -30,9 +30,16 @@ export default function BlogFeed({ blogs, loading, theme }) {
<LoadingIndicator />
</div>
) : (
blogs.map((blog) => (
<div styleName="row" key={`blog-feed-${blog.link}`}>
<a href={`${blog.link}`} target="_blank" rel="noreferrer">
blogs.map(blog => (
<div
styleName="row"
key={`blog-feed-${blog.link}`}
>
<a
href={`${blog.link}`}
target="_blank"
rel="noreferrer"
>
{blog.title}
</a>
</div>
Expand All @@ -45,11 +52,11 @@ export default function BlogFeed({ blogs, loading, theme }) {

BlogFeed.defaultProps = {
blogs: [],
theme: "light",
theme: 'light',
};

BlogFeed.propTypes = {
blogs: PT.arrayOf(PT.shape()),
loading: PT.bool.isRequired,
theme: PT.oneOf(["dark", "light"]),
theme: PT.oneOf(['dark', 'light']),
};
30 changes: 14 additions & 16 deletions src/shared/components/Dashboard/Challenges/index.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import _ from "lodash";
import LoadingIndicator from "components/LoadingIndicator";
import PT from "prop-types";
import React from "react";
import qs from "qs";
import _ from 'lodash';
import LoadingIndicator from 'components/LoadingIndicator';
import PT from 'prop-types';
import React from 'react';
import qs from 'qs';

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

import "./styles.scss";
import './styles.scss';

export default function ChallengesFeed({
challenges,
Expand All @@ -24,7 +24,7 @@ export default function ChallengesFeed({
href={`${config.URL.CHALLENGES_URL}${
challengeListingQuery
? `?${qs.stringify(challengeListingQuery)}`
: ""
: ''
}`}
target="_blank"
rel="noreferrer"
Expand All @@ -38,7 +38,7 @@ export default function ChallengesFeed({
<LoadingIndicator />
</div>
) : (
(challenges || []).map((challenge) => (
(challenges || []).map(challenge => (
<div styleName="row" key={challenge.id}>
<a
href={`/challenges/${challenge.id}`}
Expand All @@ -51,10 +51,8 @@ export default function ChallengesFeed({
<span styleName="amount">
{`$${_.sum(
challenge.prizeSets
.filter((set) => set.type === "placement")
.map((item) =>
_.sum(item.prizes.map((prize) => prize.value))
)
.filter(set => set.type === 'placement')
.map(item => _.sum(item.prizes.map(prize => prize.value))),
).toLocaleString()}`}
</span>
</div>
Expand All @@ -68,15 +66,15 @@ export default function ChallengesFeed({

ChallengesFeed.defaultProps = {
challenges: [],
theme: "light",
title: "Opportunities",
theme: 'light',
title: 'Opportunities',
challengeListingQuery: undefined,
};

ChallengesFeed.propTypes = {
challenges: PT.arrayOf(PT.shape()),
loading: PT.bool.isRequired,
theme: PT.oneOf(["dark", "light"]),
theme: PT.oneOf(['dark', 'light']),
title: PT.string,
challengeListingQuery: PT.shape(),
};
12 changes: 6 additions & 6 deletions src/shared/components/Dashboard/TCTime/index.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Topcoder Time Component
*/
import React, { useState, useEffect } from "react";
import moment from "moment-timezone";
import darkTheme from "./dark.scss";
import lightTheme from "./light.scss";
import React, { useState, useEffect } from 'react';
import moment from 'moment-timezone';
import darkTheme from './dark.scss';
import lightTheme from './light.scss';

const THEMES = {
dark: darkTheme,
Expand All @@ -13,8 +13,8 @@ const THEMES = {

function TopcoderTime() {
const theme = THEMES.light;
let FORMAT = "MMM Do, HH:mm UTC";
const TIMEZONE = "America/New_York";
let FORMAT = 'MMM Do, HH:mm UTC';
const TIMEZONE = 'America/New_York';
const now = moment.tz(new Date(), TIMEZONE);
FORMAT += now.utcOffset() / 60;
const [tcTime, setTCTime] = useState(`${now.format(FORMAT)}`);
Expand Down
14 changes: 7 additions & 7 deletions src/shared/components/Dashboard/ThriveArticlesFeed/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* Thrive Articles Feed component
*/

import LoadingIndicator from "components/LoadingIndicator";
import PT from "prop-types";
import React from "react";
import "./styles.scss";
import LoadingIndicator from 'components/LoadingIndicator';
import PT from 'prop-types';
import React from 'react';
import './styles.scss';

export default function ThriveArticlesFeed({ articles, loading, theme }) {
return (
Expand All @@ -24,7 +24,7 @@ export default function ThriveArticlesFeed({ articles, loading, theme }) {
<LoadingIndicator />
</div>
) : (
articles.map((article) => (
articles.map(article => (
<div
styleName="row"
key={`thrive-articles-feed-${article.fields.slug}`}
Expand All @@ -48,11 +48,11 @@ export default function ThriveArticlesFeed({ articles, loading, theme }) {

ThriveArticlesFeed.defaultProps = {
articles: [],
theme: "light",
theme: 'light',
};

ThriveArticlesFeed.propTypes = {
articles: PT.arrayOf(PT.shape()),
loading: PT.bool.isRequired,
theme: PT.oneOf(["dark", "light"]),
theme: PT.oneOf(['dark', 'light']),
};
33 changes: 16 additions & 17 deletions src/shared/containers/Dashboard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
/**
* SlashTC index container
*/
import React, { useEffect } from "react";
import PT from "prop-types";
import { connect } from "react-redux";
import { useMediaQuery } from "react-responsive";
import { isTokenExpired } from "@topcoder-platform/tc-auth-lib";
import { config } from "topcoder-react-utils";
import Viewport from "components/Contentful/Viewport";
import TopcoderTime from "components/Dashboard/TCTime";
import ThriveArticlesFeedContainer from "containers/Dashboard/ThriveArticlesFeed";
import React, { useEffect } from 'react';
import PT from 'prop-types';
import { connect } from 'react-redux';
import { useMediaQuery } from 'react-responsive';
import { isTokenExpired } from '@topcoder-platform/tc-auth-lib';
import { config } from 'topcoder-react-utils';
import Viewport from 'components/Contentful/Viewport';
import TopcoderTime from 'components/Dashboard/TCTime';
import ThriveArticlesFeedContainer from 'containers/Dashboard/ThriveArticlesFeed';
// deprecated with https://topcoder.atlassian.net/browse/CORE-346
// import GigsFeed from 'containers/Dashboard/GigsFeed';
import ChallengesFeed from "containers/Dashboard/ChallengesFeed";
import BlogFeedContainer from "containers/Dashboard/BlogFeed";
import MetaTags from "components/MetaTags";
import ChallengesFeed from 'containers/Dashboard/ChallengesFeed';
import BlogFeedContainer from 'containers/Dashboard/BlogFeed';
import MetaTags from 'components/MetaTags';
// deprecated with https://topcoder.atlassian.net/browse/TOP-1390
// import NewsFeed from './NewsFeed';
import darkTheme from "./themes/dark.scss";
import lightTheme from "./themes/light.scss";
import darkTheme from './themes/dark.scss';
import lightTheme from './themes/light.scss';

const THEMES = {
dark: darkTheme,
Expand All @@ -33,7 +33,7 @@ const { INNOVATION_CHALLENGES_TAG } = config;
function SlashTCContainer(props) {
const theme = THEMES.light;
const isTabletOrMobile = useMediaQuery({ maxWidth: 768 });
const title = "Home | Topcoder";
const title = 'Home | Topcoder';
const challengeListingQuery = {
search: INNOVATION_CHALLENGES_TAG,
isInnovationChallenge: true,
Expand Down Expand Up @@ -129,8 +129,7 @@ SlashTCContainer.propTypes = {
};

function mapStateToProps(state) {
const profile =
state.auth && state.auth.profile ? { ...state.auth.profile } : {};
const profile = state.auth && state.auth.profile ? { ...state.auth.profile } : {};
return {
profile,
tokenV3: state.auth.tokenV3,
Expand Down

0 comments on commit 7085fa1

Please sign in to comment.