Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit 8b688b0

Browse files
author
Daniel Baah
committed
make ts lint happy
fix npm vulnerabilities add preferred browser to package.jon
1 parent e8a7183 commit 8b688b0

10 files changed

Lines changed: 33 additions & 30 deletions

File tree

package.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-seafood",
3-
"version": "0.1.0",
3+
"version": "1.0.0",
44
"private": true,
55
"homepage": "https://map.seafoodfest.org",
66
"dependencies": {
@@ -16,7 +16,7 @@
1616
"react-dom": "^16.4.0",
1717
"react-ga": "^2.5.3",
1818
"react-redux": "^5.0.7",
19-
"react-scripts": "1.1.4",
19+
"react-scripts": "^3.0.1",
2020
"react-window-size": "^1.2.0",
2121
"redux": "^4.0.0"
2222
},
@@ -25,5 +25,17 @@
2525
"build": "react-scripts build",
2626
"test": "react-scripts test --env=jsdom",
2727
"eject": "react-scripts eject"
28+
},
29+
"browserslist": {
30+
"production": [
31+
">0.2%",
32+
"not dead",
33+
"not op_mini all"
34+
],
35+
"development": [
36+
"last 1 chrome version",
37+
"last 1 firefox version",
38+
"last 1 safari version"
39+
]
2840
}
2941
}

src/app.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Provider } from 'react-redux';
44
import { store } from './redux/store'
55
import Map from './components/map/map.js';
66
import BottomSheet from './components/bottomDrawer/bottomDrawer'
7-
import RightMenu from './components/rightDrawer/rightDrawer';
87
import Main from './components/main/main';
98
import { config } from './config';
109

@@ -20,13 +19,13 @@ class App extends Component {
2019

2120
// Initialize Google Analytics
2221
const { ga } = config;
23-
ReactGA.initialize(ga.id),{
22+
ReactGA.initialize(ga.id,{
2423
debug: true,
2524
titleCase: false,
2625
gaOptions: {
2726
name: 'dev2018'
2827
}
29-
};
28+
});
3029
ReactGA.pageview(window.location.pathname + window.location.search);
3130
}
3231

src/components/bottomDrawer/beerGarden/beerGarden.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React, {Component} from 'react';
22
import './beerGarden.css';
33
import { breweries } from "../../../redux/constants";
4-
import { Tabs, Tab } from '@material-ui/core';
5-
import { TabContainer } from '../../../helpers';
64

75
class BeerGarden extends Component {
86

src/components/bottomDrawer/bottomDrawer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class BottomSheet extends Component {
204204
if (typeof svgIcon !== "undefined") {
205205
return (<div className="key-wrapper">
206206
<div className="svg-icon">
207-
<img src={svgIcon}/>
207+
<img alt="Featured vendor icon" src={svgIcon}/>
208208
</div>
209209
</div>
210210
)
@@ -216,15 +216,15 @@ class BottomSheet extends Component {
216216
{data.id}
217217
</div>
218218
<div className="svg-pin">
219-
<img src={svgPin}/>
219+
<img alt="Vendor icon" src={svgPin}/>
220220
</div>
221221
</div>)
222222
// Show nothing
223223
} else if (data.details === "games") {
224224
return (
225225
<div className="key-wrapper">
226226
<div className="svg-games">
227-
<img src={imgIconGames}/>
227+
<img alt="Games icon" src={imgIconGames}/>
228228
</div>
229229
</div>)
230230
} else {

src/components/bottomDrawer/crabShack/crabShack.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import React, {Component} from 'react';
22
import './crabShack.css';
3-
import { Tabs, Tab } from '@material-ui/core';
4-
import { TabContainer } from '../../../helpers';
53

64
class CrabShack extends Component {
75

src/components/bottomDrawer/purpleSlide/purpleSlide.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import React, {Component} from 'react';
22
import './purpleSlide.css';
3-
import { Tabs, Tab } from '@material-ui/core';
4-
import { TabContainer } from '../../../helpers';
53

64
class PurpleSlide extends Component {
75

src/components/leftDrawer/leftDrawer.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { Component } from 'react';
22
import { connect } from 'react-redux'
33
import PropTypes from 'prop-types';
4-
import { isBrowser } from 'react-device-detect';
54
import { withStyles } from '@material-ui/core/styles';
65
import withWidth from '@material-ui/core/withWidth';
76
import SwipeableDrawer from '@material-ui/core/SwipeableDrawer';
@@ -107,35 +106,35 @@ class LeftDrawer extends Component {
107106
}}
108107
>
109108
{/* Drawer Flier Image */}
110-
<img className="Flier" src={imgFlier}/>
109+
<img alt="Official Seafood Fest Flier" className="Flier" src={imgFlier}/>
111110

112111
{/* Map Legend */}
113112
<div className="Legend">
114113
<div className="legend-title">Map legend:</div>
115114
<div className="legend-item-wrapper">
116115
<span className="legend-box">
117-
<img className="map-pin" src={imgIconEntertainment}/>
116+
<img alt="Entertainment" className="map-pin" src={imgIconEntertainment}/>
118117
</span>
119118
<span className="legend-item-text">Entertainment</span>
120119
</div>
121120
<div className="legend-item-wrapper">
122121
<span className="legend-box">
123-
<img className="map-pin" src={imgIconArts}/></span>
122+
<img alt="Arts & Crafts" className="map-pin" src={imgIconArts}/></span>
124123
<span className="legend-item-text">Arts & Crafts</span>
125124
</div>
126125
<div className="legend-item-wrapper">
127126
<span className="legend-box">
128-
<img className="map-pin" src={imgIconFoods}/></span>
127+
<img alt="Food" className="map-pin" src={imgIconFoods}/></span>
129128
<span className="legend-item-text">Food</span>
130129
</div>
131130
<div className="legend-item-wrapper">
132131
<span className="legend-box">
133-
<img className="map-pin" src={imgIconSponsors}/></span>
132+
<img alt="Sponsors" className="map-pin" src={imgIconSponsors}/></span>
134133
<span className="legend-item-text">Sponsors/Non-Profits</span>
135134
</div>
136135
<div className="legend-item-wrapper">
137136
<span className="legend-box">
138-
<img className="map-pin" src={imgIconMisc}/></span>
137+
<img alt="Miscellaneous" className="map-pin" src={imgIconMisc}/></span>
139138
<span className="legend-item-text">Other</span>
140139
</div>
141140
<div className="legend-item-wrapper">
@@ -151,7 +150,7 @@ class LeftDrawer extends Component {
151150
<div className="legend-title sub-section">Don't Miss:</div>
152151
<List>
153152
<ListItem className="list-item-wrapper" button onClick={() => {
154-
{/* Close the right & left menu */}
153+
// Close the right & left menu
155154
toggleRightDrawer(true);
156155
toggleLeftDrawer(false);
157156
setTabValue({index: 1, name: "Food"});
@@ -170,7 +169,7 @@ class LeftDrawer extends Component {
170169
})}
171170
<Divider/>
172171
{/* Go to seafoodfest.org */}
173-
<a className="list-link" href="https://seafoodfest.org/" target="_blank">
172+
<a className="list-link" href="https://seafoodfest.org/" target="_blank" rel="noopener noreferrer">
174173
<ListItem classes={{root: classes.list }} className="list-item-wrapper" button>
175174
<ListItemText disableTypography={true} classes={{root: 'list-item-text'}} primary="Seafood Fest Org"/>
176175
</ListItem>

src/components/main/main.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { Component } from 'react';
22
import { connect } from 'react-redux'
33
import PropTypes from 'prop-types';
4-
import { isBrowser } from 'react-device-detect';
54
import classNames from 'classnames';
65
import { withStyles } from '@material-ui/core/styles';
76
import AppBar from '@material-ui/core/AppBar';
@@ -87,8 +86,7 @@ class Main extends Component {
8786
}
8887

8988
render() {
90-
const { classes, leftDrawerOptions } = this.props;
91-
const { anchor, open } = leftDrawerOptions;
89+
const { classes } = this.props;
9290

9391
return (
9492
<div className={classes.root}>
@@ -104,7 +102,7 @@ class Main extends Component {
104102
</IconButton>
105103
</Hidden>
106104
<div className={classes.flex}>
107-
<img onClick={()=>{this.resetView()}} className={classes.navLogo} src={imgNavLogo} />
105+
<img alt="Reset application" onClick={()=>{this.resetView()}} className={classes.navLogo} src={imgNavLogo} />
108106
</div>
109107
<Button onClick={()=>{toggleRightDrawer(true)}} className="vendorButton">Vendor List</Button>
110108
</Toolbar>

src/components/map/map.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class Map extends Component {
160160
* see https://developer.mozilla.org/en-US/docs/Web/API/PositionError
161161
* @param error
162162
*/
163-
handleGeolocationError = (error: PositionError) => {
163+
handleGeolocationError = (error) => {
164164

165165
let message;
166166
switch (error.code) {
@@ -173,6 +173,8 @@ class Map extends Component {
173173
case error.TIMEOUT:
174174
message = "The request to get user location timed out.";
175175
break;
176+
default:
177+
message = "Error handling Geolocation button select."
176178
}
177179

178180
findMyLocation({type: FIND_MY_LOCATION_ERROR, payload: message})

src/redux/reducer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ import {
33
SET_TAB_VALUE, SET_MAP
44
} from './constants'
55
import polygonData from '../data/polygons_2018'
6-
import { isBrowser } from 'react-device-detect';
76

87
// Sort feature collection by vendor name
98
const sortFeatures = (a,b) => {
109
if( a.properties.name > b.properties.name) return 1;
1110
if( a.properties.name < b.properties.name) return -1;
1211
}
1312

14-
const initialState: State = {
13+
const initialState = {
1514
polygonData: {
1615
...polygonData,
1716
features: polygonData.features.sort(sortFeatures)

0 commit comments

Comments
 (0)