-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintcache
More file actions
1 lines (1 loc) · 11.2 KB
/
.eslintcache
File metadata and controls
1 lines (1 loc) · 11.2 KB
1
[{"/Users/Nickypack11/Desktop/WEBAPP/ESS/src/App.js":"1","/Users/Nickypack11/Desktop/WEBAPP/ESS/src/reportWebVitals.js":"2","/Users/Nickypack11/Desktop/WEBAPP/ESS/src/firebase.js":"3","/Users/Nickypack11/Desktop/WEBAPP/ESS/src/index.js":"4","/Users/Nickypack11/Desktop/WEBAPP/ESS/src/ImageUploader/index.js":"5"},{"size":8242,"mtime":1606708484790,"results":"6","hashOfConfig":"7"},{"size":362,"mtime":1606520759340,"results":"8","hashOfConfig":"7"},{"size":1096,"mtime":1606520759339,"results":"9","hashOfConfig":"7"},{"size":500,"mtime":1606520759339,"results":"10","hashOfConfig":"7"},{"size":2379,"mtime":1606625859169,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":"14"},"iq5trp",{"filePath":"15","messages":"16","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"17"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/Nickypack11/Desktop/WEBAPP/ESS/src/App.js",["24","25","26","27","28"],"import React, { Component } from 'react';\nimport './App.css';\nimport firebase, { auth, provider, storage } from './firebase.js';\nimport ImageUpload from './ImageUploader/index';\nimport { Tab, Tabs, TabList, TabPanel } from 'react-tabs';\nimport 'react-tabs/style/react-tabs.css';\n\n// Run this using 'npm start' !!!\n// To do list:\n// Add dropdown menu selection to display! (Mostly done, fix \n// reset of kind state when something is input after selection)\n// ^Form Validation for fixing reset\n// Placement of boxes when displaying items?\n// Need to add ability to submit photos + be seen by users\n// Placement + css of dropdown for essential supplies\n// Notification system to users?\n// Turn logout button into a drop down menu with logout, about, \nclass App extends Component {\n constructor(props) {\n super(props);\n this.state = {\n currentItem: '',\n username: '',\n location: '',\n kind: '',\n photo: '',\n items: [],\n user: null\n }\n this.handleChange = this.handleChange.bind(this);\n this.handleKindChange = this.handleKindChange.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n this.login = this.login.bind(this);\n this.logout = this.logout.bind(this);\n }\n handleChange(e) {\n this.setState({\n [e.target.name]: e.target.value,\n });\n }\n handleKindChange(e) {\n this.setState({\n kind: e.target.value\n });\n }\n logout() {\n auth.signOut()\n .then(() => {\n this.setState({\n user: null\n });\n });\n }\n login() {\n auth.signInWithPopup(provider)\n .then((result) => {\n const user = result.user;\n this.setState({\n user\n });\n });\n }\n handleSubmit(e) {\n e.preventDefault();\n const itemsRef = firebase.database().ref('items');\n const item = {\n title: this.state.currentItem,\n user: this.state.user.displayName || this.state.user.email,\n location: this.state.location,\n kind: this.state.kind,\n }\n itemsRef.push(item);\n this.setState({\n currentItem: '',\n username: '',\n location: '',\n });\n }\n handleUpload = () => {\n const { image } = this.state;\n const uploadTask = storage.ref('images/${')\n }\n componentDidMount() {\n const itemsRef = firebase.database().ref('items');\n auth.onAuthStateChanged((user) => {\n if (user) {\n this.setState({ user });\n }\n });\n itemsRef.on('value', (snapshot) => {\n let items = snapshot.val();\n let newState = [];\n for (let item in items) {\n newState.push({\n id: item,\n title: items[item].title,\n user: items[item].user,\n location: items[item].location,\n kind: items[item].kind,\n photo: items[item].photo\n });\n }\n this.setState({\n items: newState\n });\n });\n }\n removeItem(itemId) {\n const itemRef = firebase.database().ref(`/items/${itemId}`);\n itemRef.remove();\n }\n render() {\n return (\n <Tabs className=\"tabs-background\">\n <header>\n <div className=\"wrapper\">\n <div className=\"title\">\n <h1>Essential Supplies Stock</h1>\n <p> </p>\n <h3>Find Essential Supplies Here!</h3>\n </div>\n {this.state.user ?\n <button onClick={this.logout}>Logout</button>\n :\n <button onClick={this.login}>Log In</button>\n }\n </div>\n </header>\n <TabList className=\"tabs\">\n <Tab className=\"tab1\">ESSENTIAL SUPPLY STOCK</Tab>\n <Tab className=\"tab2\">ABOUT PAGE</Tab>\n </TabList>\n <TabPanel>\n <div className='app'>\n {this.state.user ?\n <div>\n <div className='user-profile'>\n <img src={this.state.user.photoURL} />\n </div>\n <div className='container'>\n <section className='display-item'>\n <div className=\"wrapper\">\n <ul>\n {this.state.items.map((item) => {\n return (\n <li key={item.id}>\n <h3>Supply: {item.title}</h3>\n <h3>Location: {item.location}</h3>\n <h3> Type of supply: {item.kind}</h3>\n <div>\n <img\n src={this.state.url || \"https://via.placeholder.com/300x300\"}\n alt=\"Uploaded Image from user\"\n height=\"300\"\n width=\"308\"\n />\n </div>\n <p>From {item.user}\n {item.user === this.state.user.displayName || item.user === this.state.user.email ?\n <button className=\"remove\" onClick={() => this.removeItem(item.id)}>Remove Item</button> : null}\n </p>\n </li>\n )\n })}\n </ul>\n </div>\n </section>\n </div>\n <div className='container'>\n <section className='add-item'>\n <form onSubmit={this.handleSubmit} onChange={this.handleChange}>\n <p className=\"itemlabel\">Enter product information:</p>\n <input type=\"text\" name=\"username\" placeholder=\"What's your name?\" value={this.state.user.displayName || this.state.user.email} />\n <input type=\"text\" name=\"currentItem\" placeholder=\"What did you find?\" onChange={this.handleChange} value={this.state.currentItem} />\n <input type=\"text\" name=\"location\" placeholder=\"Where did you find this?\" onChange={this.handleChange} value={this.state.location} />\n <label for=\"item\"><h3> What kind of essential supply?</h3></label>\n <select className=\"dropdown\" id=\"item\" onChange={this.handleKindChange}>\n <option selected value=\"\">Please choose an option</option>\n <option value=\"Toilet Paper\">Toilet Paper</option>\n <option value=\"Pack of Water Bottles\">Pack of Water Bottles</option>\n <option value=\"Hand Sanitizer\">Hand Sanitizer</option>\n <option value=\"Dried/Canned Food\">Dried/Canned Food</option>\n <option value=\"Masks\">Masks</option>\n <option value = \"Water Purifier\"> Water Purifier</option>\n <option value = \"First Aid Kit\"> First Aid Kit</option>\n <option value = \"Frozen Foods\">Frozen Foods </option>\n <option value = \"Tissues\"> Tissues</option>\n </select>\n <button className=\"submitbutton\">Add Item</button>\n </form>\n </section>\n </div>\n </div>\n :\n <div className='wrapper'>\n <p> <h2> You must be logged in to see the stock.</h2></p>\n </div>\n }\n </div>\n </TabPanel>\n <TabPanel>\n <div style={{ height: 400, padding: 20, background: 'darkgray'}}> \n <h1>Welcome to Essential Supply Stock!</h1>\n <h2>Helping you find essential supplies near you!</h2>\n <h1>~ ~ ~</h1>\n <p>During the Covid-19 pandemic, there have been shortages of essential supplies</p>\n <p>including toilet paper, tissues, bottled water, hand sanitizer, masks, canned food, and first aid kits.</p>\n <p>Our mission here at Essential Supplies Stock is to help users find locations where essential supplies</p>\n <p>are currently in stock, making trips to stores more meaningful and productive.</p>\n </div>\n </TabPanel>\n </Tabs>\n );\n }\n}\nexport default App;\n","/Users/Nickypack11/Desktop/WEBAPP/ESS/src/reportWebVitals.js",[],["29","30"],"/Users/Nickypack11/Desktop/WEBAPP/ESS/src/firebase.js",[],"/Users/Nickypack11/Desktop/WEBAPP/ESS/src/index.js",[],"/Users/Nickypack11/Desktop/WEBAPP/ESS/src/ImageUploader/index.js",[],{"ruleId":"31","severity":1,"message":"32","line":4,"column":8,"nodeType":"33","messageId":"34","endLine":4,"endColumn":19},{"ruleId":"31","severity":1,"message":"35","line":80,"column":13,"nodeType":"33","messageId":"34","endLine":80,"endColumn":18},{"ruleId":"31","severity":1,"message":"36","line":81,"column":11,"nodeType":"33","messageId":"34","endLine":81,"endColumn":21},{"ruleId":"37","severity":1,"message":"38","line":138,"column":19,"nodeType":"39","endLine":138,"endColumn":57},{"ruleId":"40","severity":1,"message":"41","line":151,"column":33,"nodeType":"39","endLine":156,"endColumn":35},{"ruleId":"42","replacedBy":"43"},{"ruleId":"44","replacedBy":"45"},"no-unused-vars","'ImageUpload' is defined but never used.","Identifier","unusedVar","'image' is assigned a value but never used.","'uploadTask' is assigned a value but never used.","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement","jsx-a11y/img-redundant-alt","Redundant alt attribute. Screen-readers already announce `img` tags as an image. You don’t need to use the words `image`, `photo,` or `picture` (or any specified custom words) in the alt prop.","no-native-reassign",["46"],"no-negated-in-lhs",["47"],"no-global-assign","no-unsafe-negation"]