Skip to content

Commit

Permalink
took path of least resistance to fix some lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsage88 committed Apr 27, 2022
1 parent 4871b35 commit 96e8091
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 63 deletions.
4 changes: 3 additions & 1 deletion src/components/Context/index.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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();
}
Expand Down
3 changes: 1 addition & 2 deletions src/components/Loader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import PropTypes from 'prop-types';
import {Consumer} from './Context';

const Loader = () => {
Expand All @@ -13,7 +12,7 @@ const Loader = () => {
<form method="dialog">
<p data-testid="loaderPEL" id="loaderP" className="title retroFont">LOADING</p>
<menu id="loaderMenuEl" className="dialog-menu">
<img data-testid="loaderImgEl" id="loaderImg" src={context.loaderImage} />
<img alt="" data-testid="loaderImgEl" id="loaderImg" src={context.loaderImage} />
</menu>
</form>
</dialog>
Expand Down
4 changes: 2 additions & 2 deletions src/components/MainGameData.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {Component} from 'react';
import React from 'react';
import Notice from './Notice';


Expand All @@ -10,7 +10,7 @@ const MainGameData = (props) => {
<h1 id="mainGameTitleH1" data-testid="mainGameDataH1El" className='nintendoFont'>
{props.gameData.name}
</h1>
<img id="mainGameImage" data-testid="mainGameImgEl" src={props.gameData.coverUrl} />
<img alt="" id="mainGameImage" data-testid="mainGameImgEl" src={props.gameData.coverUrl} />
<table id="mainGameTable" className='nes-table is-bordered is-dark snesFont'>
<thead>
<tr id="mainGameTableHeadRow">
Expand Down
97 changes: 50 additions & 47 deletions src/components/Notice.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,67 @@
import React from 'react';
import {Consumer} from './Context';
import { Consumer } from './Context';

const Notice = (props) => {
return(
return (
<Consumer>
{
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 = <img data-testid={'noticeImg-search'} value={number} src={context.searchNoticeImages[number]} />
break;
const generateNotice = (context, props) => {
if (context) {
let notice, number;
switch (props.type) {
case 'search':
number = Math.floor(Math.random() * context.searchNoticeImages.length);
notice = <img alt="" data-testid={'noticeImg-search'} value={number} src={context.searchNoticeImages[number]} />
break;

case 'noGraph':
number = Math.floor(Math.random()*context.noGraphSet.length);
notice =<section data-testid={'noticeSection-noGraph'} className="message-list">
<section className="message -right">
<div className="nes-balloon from-right">
<p>{context.noGraphSet[number].text}</p>
</div>
<img src={context.noGraphSet[number].image}/>
case 'noGraph':
number = Math.floor(Math.random() * context.noGraphSet.length);
notice = <section data-testid={'noticeSection-noGraph'} className="message-list">
<section className="message -right">
<div className="nes-balloon from-right">
<p>{context.noGraphSet[number].text}</p>
</div>
<img src={context.noGraphSet[number].image} alt=""/>
</section>
</section>
</section>
break;
break;

case 'noGame':
number = Math.floor(Math.random()*context.noGameSet.length);
notice =<section data-testid="noticeSection-noGame" className="message-list">
<section className="message -right">
<div className="nes-balloon from-right">
<p>{context.noGameSet[number].text}</p>
</div>
<img src={context.noGameSet[number].image}/>
</section>
</section>

}
return notice
case 'noGame':
number = Math.floor(Math.random() * context.noGameSet.length);
notice = <section data-testid="noticeSection-noGame" className="message-list">
<section className="message -right">
<div className="nes-balloon from-right">
<p>{context.noGameSet[number].text}</p>
</div>
<img alt="" src={context.noGameSet[number].image} />
</section>
</section>
break;
default:
null;
break;
}
return notice
}
}
}

return (
<div data-testid="noticeDivEl" id="noticeDiv">

{generateNotice(context, props)}
</div>
)
}
}

return (
<div data-testid="noticeDivEl" id="noticeDiv">

{generateNotice(context, props)}
</div>
)
}
}
</Consumer>
)

}

Notice.defaultProps = {
context : {
context: {
searchNoticeImages: [],
noGameSet: []
}
Expand Down
5 changes: 2 additions & 3 deletions src/components/RelatedGames.js
Original file line number Diff line number Diff line change
@@ -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) => {

Expand Down
2 changes: 1 addition & 1 deletion src/components/Results.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Provider, Consumer} from './Context';
import {Consumer} from './Context';


const Results = (props) => {
Expand Down
6 changes: 0 additions & 6 deletions src/components/Searchbar.js
Original file line number Diff line number Diff line change
@@ -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 (
<Consumer>

Expand Down
2 changes: 1 addition & 1 deletion src/components/Trend.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Trend = (props) => {
<h5 data-testid={'trend/gameName-'+index}>{game.name}</h5>
<span data-testid={'trend/releaseDate-'+index}>{game.releaseDate}</span>
<progress data-testid={'trend/progress-'+index} className={barColorClass} value={game.aggregatedRating} max="100"></progress>
<a data-testid={'trend/badge-'+index} className="nes-badge">
<a href="" data-testid={'trend/badge-'+index} className="nes-badge">
<span data-testid={'trend/badgeSpan-'+index} className="is-dark">RATING: {game.aggregatedRating}</span>
</a>
</div>
Expand Down

0 comments on commit 96e8091

Please sign in to comment.