diff --git a/.eslintrc b/.eslintrc index 02ace66fc8..c323322f56 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,10 +4,7 @@ "jsx-a11y/anchor-is-valid": false, "import/no-cycle": [2, { "maxDepth": 1 }], "react/forbid-prop-types": false, - "react/no-unknown-property": false, - "react/jsx-no-bind": false, - "react/destructuring-assignment": false, - "react/no-array-index-key": false + "react/no-unknown-property": ["error", { "ignore": ["styleName"] }] }, "env": { "browser": true diff --git a/src/shared/components/Contentful/AppComponent/index.jsx b/src/shared/components/Contentful/AppComponent/index.jsx index a012fb82e9..f1d84bcd03 100644 --- a/src/shared/components/Contentful/AppComponent/index.jsx +++ b/src/shared/components/Contentful/AppComponent/index.jsx @@ -18,41 +18,59 @@ import PathSelector from 'components/MemberPath/PathSelector'; const { fireErrorMessage } = errors; export function AppComponentSwitch(appComponent) { - if (appComponent.fields.type === 'TCO-Leaderboard') { + const { + fields: { + type, + theme, + props, + props: { + leaderboardApiUrl, + title, + podiumSpots, + isCopilot, + hasChallengeHistory, + tcoPointsApiUrl, + memberLimit, + isAlgo, + }, + }, + sys: { id }, + } = appComponent; + if (type === 'TCO-Leaderboard') { return ( ); } - if (appComponent.fields.type === 'RecruitCRM-Jobs') { - return ; + if (type === 'RecruitCRM-Jobs') { + return ; } - if (appComponent.fields.type === 'EmailSubscribeForm') { - return ; + if (type === 'EmailSubscribeForm') { + return ; } - if (appComponent.fields.type === 'GSheet') { - return ; + if (type === 'GSheet') { + return ; } - if (appComponent.fields.type === 'MemberPath') { + if (type === 'MemberPath') { return ( ); } - fireErrorMessage(`Unsupported app component type ${appComponent.fields.type}`, ''); + fireErrorMessage(`Unsupported app component type ${type}`, ''); return null; } diff --git a/src/shared/components/Contentful/Viewport/index.jsx b/src/shared/components/Contentful/Viewport/index.jsx index 30d3a78e28..cf89dec2ac 100644 --- a/src/shared/components/Contentful/Viewport/index.jsx +++ b/src/shared/components/Contentful/Viewport/index.jsx @@ -272,7 +272,7 @@ export function ViewportLoader(props) { } if (query) { - queries.push({ ...props.query, content_type: 'viewport' }); + queries.push({ ...query, content_type: 'viewport' }); } return ( diff --git a/src/shared/components/Gigs/ReferralCode/index.jsx b/src/shared/components/Gigs/ReferralCode/index.jsx index 1ed5597794..1de0976d45 100644 --- a/src/shared/components/Gigs/ReferralCode/index.jsx +++ b/src/shared/components/Gigs/ReferralCode/index.jsx @@ -25,7 +25,7 @@ function ReferralCode(props) { const [growSurfState, setGrowSurfState] = useState(growSurf); const [copyBtnText, setCopyBtnText] = useState('COPY'); useEffect(() => { - setGrowSurfState(props.growSurf); + setGrowSurfState(growSurf); }, [growSurf]); return ( diff --git a/src/shared/components/Settings/Account/LinkedAccount/ExistingLink.jsx b/src/shared/components/Settings/Account/LinkedAccount/ExistingLink.jsx index c0654a5b43..27fb7c9019 100644 --- a/src/shared/components/Settings/Account/LinkedAccount/ExistingLink.jsx +++ b/src/shared/components/Settings/Account/LinkedAccount/ExistingLink.jsx @@ -64,7 +64,15 @@ export default function ExistingLink(props) { return (
openLink(e, link)}>
-
onConfirmDeleteLink(e, link)} styleName={`ext-link-tile_edit-header_delete ${link.deleting ? 'ext-link-tile_edit-header_delete--disabled' : ''}`} prevent-event-propagation="true" /> +
{ + e.preventDefault(); + e.stopPropagation(); + onConfirmDeleteLink(e, link); + }} + styleName={`ext-link-tile_edit-header_delete ${link.deleting ? 'ext-link-tile_edit-header_delete--disabled' : ''}`} + />
@@ -94,7 +102,7 @@ export default function ExistingLink(props) {

Loading data. This will take a few minutes.

- + {prependProtocol(link.URL)}
diff --git a/src/shared/components/challenge-detail/Header/TabSelector/index.jsx b/src/shared/components/challenge-detail/Header/TabSelector/index.jsx index dcdc49f122..f7c9d104f1 100644 --- a/src/shared/components/challenge-detail/Header/TabSelector/index.jsx +++ b/src/shared/components/challenge-detail/Header/TabSelector/index.jsx @@ -404,9 +404,9 @@ export default function ChallengeViewSelector(props) {
{ - sortOptions.map((option, index) => ( + sortOptions.map(option => (
{ setSelectedSortOption(option.name); diff --git a/src/shared/components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow/index.jsx b/src/shared/components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow/index.jsx index 5510ef4741..750458887b 100644 --- a/src/shared/components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow/index.jsx +++ b/src/shared/components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow/index.jsx @@ -21,7 +21,6 @@ const { getService } = services.submissions; export default function SubmissionHistoryRow({ isMM, - isRDM, submission, finalScore, provisionalScore, @@ -82,7 +81,7 @@ export default function SubmissionHistoryRow({
{ - isLoggedIn && (isMM || isRDM) + isLoggedIn && isMM && (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
Action
@@ -122,7 +121,6 @@ SubmissionHistoryRow.defaultProps = { SubmissionHistoryRow.propTypes = { isMM: PT.bool.isRequired, - isRDM: PT.bool.isRequired, submission: PT.number.isRequired, finalScore: PT.oneOfType([ PT.number, diff --git a/src/shared/components/challenge-detail/Submissions/SubmissionRow/index.jsx b/src/shared/components/challenge-detail/Submissions/SubmissionRow/index.jsx index b2fc9cca9b..f4a61b11bb 100644 --- a/src/shared/components/challenge-detail/Submissions/SubmissionRow/index.jsx +++ b/src/shared/components/challenge-detail/Submissions/SubmissionRow/index.jsx @@ -19,7 +19,7 @@ import SubmissionHistoryRow from './SubmissionHistoryRow'; import style from './style.scss'; export default function SubmissionRow({ - isMM, isRDM, openHistory, member, submissions, score, toggleHistory, challengeStatus, + isMM, openHistory, member, submissions, score, toggleHistory, challengeStatus, isReviewPhaseComplete, finalRank, provisionalRank, onShowPopup, rating, viewAsTable, numWinners, auth, isLoggedIn, }) { @@ -166,8 +166,7 @@ export default function SubmissionRow({ Time
{ - (isMM || isRDM) - && (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && ( + isMM && (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
Action
@@ -186,7 +185,6 @@ export default function SubmissionRow({ 0 || challenge.status === CHALLENGE_STATUS.COMPLETED) - && (isMM || isRDM) && isLoggedIn) && ( + && isMM && isLoggedIn) && (