From 96e8091565d10d411e6fbba1dba11fbd18f4a957 Mon Sep 17 00:00:00 2001 From: lightsage88 Date: Tue, 26 Apr 2022 17:30:17 -0700 Subject: [PATCH] took path of least resistance to fix some lint errors --- src/components/Context/index.js | 4 +- src/components/Loader.js | 3 +- src/components/MainGameData.js | 4 +- src/components/Notice.js | 97 +++++++++++++++++---------------- src/components/RelatedGames.js | 5 +- src/components/Results.js | 2 +- src/components/Searchbar.js | 6 -- src/components/Trend.js | 2 +- 8 files changed, 60 insertions(+), 63 deletions(-) diff --git a/src/components/Context/index.js b/src/components/Context/index.js index 2e51bac..61335f0 100644 --- a/src/components/Context/index.js +++ b/src/components/Context/index.js @@ -1,6 +1,5 @@ import React, {Component} from 'react'; import axios from 'axios'; -import moment from 'moment'; import search1 from '../../picturesForCrosspad/needSearchImages/search-1.png'; import search2 from '../../picturesForCrosspad/needSearchImages/search-2.png'; import search3 from '../../picturesForCrosspad/needSearchImages/search-3.png'; @@ -332,6 +331,9 @@ export class Provider extends Component{ case 'coin' : sound.src = 'https://themushroomkingdom.net/sounds/wav/smw/smw_coin.wav' break; + default: + null; + break; } sound.play(); } diff --git a/src/components/Loader.js b/src/components/Loader.js index a409fe2..38436fd 100644 --- a/src/components/Loader.js +++ b/src/components/Loader.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {Consumer} from './Context'; const Loader = () => { @@ -13,7 +12,7 @@ const Loader = () => {

LOADING

- +
diff --git a/src/components/MainGameData.js b/src/components/MainGameData.js index 956984c..2e26bbf 100644 --- a/src/components/MainGameData.js +++ b/src/components/MainGameData.js @@ -1,4 +1,4 @@ -import React, {Component} from 'react'; +import React from 'react'; import Notice from './Notice'; @@ -10,7 +10,7 @@ const MainGameData = (props) => {

{props.gameData.name}

- + diff --git a/src/components/Notice.js b/src/components/Notice.js index c6d400f..2537db2 100644 --- a/src/components/Notice.js +++ b/src/components/Notice.js @@ -1,64 +1,67 @@ import React from 'react'; -import {Consumer} from './Context'; +import { Consumer } from './Context'; const Notice = (props) => { - return( + return ( - { - context => { + { + context => { - const generateNotice = (context, props) => { - if(context) { - let notice, number; - switch(props.type) { - case 'search': - number = Math.floor(Math.random()*context.searchNoticeImages.length); - notice = - break; + const generateNotice = (context, props) => { + if (context) { + let notice, number; + switch (props.type) { + case 'search': + number = Math.floor(Math.random() * context.searchNoticeImages.length); + notice = + break; - case 'noGraph': - number = Math.floor(Math.random()*context.noGraphSet.length); - notice =
-
-
-

{context.noGraphSet[number].text}

-
- + case 'noGraph': + number = Math.floor(Math.random() * context.noGraphSet.length); + notice =
+
+
+

{context.noGraphSet[number].text}

+
+ +
-
- break; + break; - case 'noGame': - number = Math.floor(Math.random()*context.noGameSet.length); - notice =
-
-
-

{context.noGameSet[number].text}

-
- -
-
- - } - return notice + case 'noGame': + number = Math.floor(Math.random() * context.noGameSet.length); + notice =
+
+
+

{context.noGameSet[number].text}

+
+ +
+
+ break; + default: + null; + break; + } + return notice + } } - } - - return ( -
- - {generateNotice(context, props)} -
- ) - } - } + + return ( +
+ + {generateNotice(context, props)} +
+ ) + } + } ) - + } Notice.defaultProps = { - context : { + context: { searchNoticeImages: [], noGameSet: [] } diff --git a/src/components/RelatedGames.js b/src/components/RelatedGames.js index 56237e0..05d189e 100644 --- a/src/components/RelatedGames.js +++ b/src/components/RelatedGames.js @@ -1,8 +1,7 @@ import React from 'react'; -import { Card, CardImg, CardTitle, CardDeck, CardText, CardGroup, - CardSubtitle, CardBody } from 'reactstrap'; +import { Card, CardImg, CardTitle, CardDeck, CardText, + CardBody } from 'reactstrap'; import Notice from './Notice'; -import {Consumer} from './Context'; const RelatedGames = (props) => { diff --git a/src/components/Results.js b/src/components/Results.js index 37cd8b5..a20e1db 100644 --- a/src/components/Results.js +++ b/src/components/Results.js @@ -1,5 +1,5 @@ import React from 'react'; -import {Provider, Consumer} from './Context'; +import {Consumer} from './Context'; const Results = (props) => { diff --git a/src/components/Searchbar.js b/src/components/Searchbar.js index 72c53d9..a6d19e5 100644 --- a/src/components/Searchbar.js +++ b/src/components/Searchbar.js @@ -1,13 +1,7 @@ import React from 'react'; import {Consumer} from './Context'; -import Accordion from 'react-bootstrap/Accordion'; - -import PropTypes from 'prop-types'; - const Searchbar = () => { - - return ( diff --git a/src/components/Trend.js b/src/components/Trend.js index c7d9e92..e64becc 100644 --- a/src/components/Trend.js +++ b/src/components/Trend.js @@ -61,7 +61,7 @@ const Trend = (props) => {
{game.name}
{game.releaseDate} - + RATING: {game.aggregatedRating}