-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 51.7 KB
/
.eslintcache
1
[{"C:\\Users\\emman\\project\\src\\index.js":"1","C:\\Users\\emman\\project\\src\\reportWebVitals.js":"2","C:\\Users\\emman\\project\\src\\components\\App\\App.js":"3","C:\\Users\\emman\\project\\src\\utilities\\projectAPI.js":"4","C:\\Users\\emman\\project\\src\\components\\Navbar\\Navbar.js":"5","C:\\Users\\emman\\project\\src\\components\\Home\\Home.js":"6","C:\\Users\\emman\\project\\src\\components\\SearchBar\\SearchBar.js":"7","C:\\Users\\emman\\project\\src\\components\\ProductList\\ProductList.js":"8","C:\\Users\\emman\\project\\src\\components\\Product\\Product.js":"9","C:\\Users\\emman\\project\\src\\components\\Sell\\Sell.js":"10","C:\\Users\\emman\\project\\src\\components\\Browse\\Browse.js":"11","C:\\Users\\emman\\project\\src\\components\\Account\\Account.js":"12","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\index.js":"13","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\reportWebVitals.js":"14","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\App\\App.js":"15","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Footer\\Footer.js":"16","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\utilities\\projectAPI.js":"17","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Authenticate\\Authenticate.js":"18","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Navbar\\Navbar.js":"19","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\Browse\\Browse.js":"20","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\Landing\\Landing.js":"21","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\NotFound\\NotFound.js":"22","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\Home\\Home.js":"23","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\Account\\Account.js":"24","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\Sell\\Sell.js":"25","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Category\\Category.js":"26","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\ProductList\\ProductList.js":"27","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\CategoryList\\CategoryList.js":"28","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Product\\Product.js":"29","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\SearchBar\\SearchBar.js":"30","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Intro\\Intro.js":"31","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Info\\Info.js":"32","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Modal\\Modal.js":"33"},{"size":515,"mtime":1612116440416,"results":"34","hashOfConfig":"35"},{"size":362,"mtime":499162500000,"results":"36","hashOfConfig":"35"},{"size":1521,"mtime":1613091174015,"results":"37","hashOfConfig":"35"},{"size":1721,"mtime":1613090446901,"results":"38","hashOfConfig":"35"},{"size":1312,"mtime":1613090785799,"results":"39","hashOfConfig":"35"},{"size":429,"mtime":1612463773283,"results":"40","hashOfConfig":"35"},{"size":637,"mtime":1612397271746,"results":"41","hashOfConfig":"35"},{"size":469,"mtime":1612463577122,"results":"42","hashOfConfig":"35"},{"size":578,"mtime":1612464021226,"results":"43","hashOfConfig":"35"},{"size":2109,"mtime":1612908043910,"results":"44","hashOfConfig":"35"},{"size":107,"mtime":1612464472889,"results":"45","hashOfConfig":"35"},{"size":108,"mtime":1613090732257,"results":"46","hashOfConfig":"35"},{"size":515,"mtime":1617048407924,"results":"47","hashOfConfig":"48"},{"size":362,"mtime":499162500000,"results":"49","hashOfConfig":"48"},{"size":3007,"mtime":1655427420321,"results":"50","hashOfConfig":"48"},{"size":170,"mtime":1653832251044,"results":"51","hashOfConfig":"48"},{"size":3132,"mtime":1654389667531,"results":"52","hashOfConfig":"48"},{"size":8939,"mtime":1655427418860,"results":"53","hashOfConfig":"48"},{"size":3918,"mtime":1653784160398,"results":"54","hashOfConfig":"48"},{"size":3061,"mtime":1655427418866,"results":"55","hashOfConfig":"48"},{"size":7316,"mtime":1642432111000,"results":"56","hashOfConfig":"48"},{"size":328,"mtime":1642432111000,"results":"57","hashOfConfig":"48"},{"size":5508,"mtime":1655427418868,"results":"58","hashOfConfig":"48"},{"size":13984,"mtime":1655427418866,"results":"59","hashOfConfig":"48"},{"size":8144,"mtime":1655427418869,"results":"60","hashOfConfig":"48"},{"size":645,"mtime":1653832033244,"results":"61","hashOfConfig":"48"},{"size":4458,"mtime":1655427418865,"results":"62","hashOfConfig":"48"},{"size":771,"mtime":1653831814328,"results":"63","hashOfConfig":"48"},{"size":8158,"mtime":1655427418864,"results":"64","hashOfConfig":"48"},{"size":927,"mtime":1653832615492,"results":"65","hashOfConfig":"48"},{"size":728,"mtime":1653832400692,"results":"66","hashOfConfig":"48"},{"size":273,"mtime":1654389805854,"results":"67","hashOfConfig":"48"},{"size":1319,"mtime":1654382172917,"results":"68","hashOfConfig":"48"},{"filePath":"69","messages":"70","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"71"},"mjdhyt",{"filePath":"72","messages":"73","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"71"},{"filePath":"74","messages":"75","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"76","messages":"77","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"78","messages":"79","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"80","messages":"81","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"71"},{"filePath":"82","messages":"83","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"71"},{"filePath":"84","messages":"85","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"71"},{"filePath":"86","messages":"87","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"71"},{"filePath":"88","messages":"89","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"90","usedDeprecatedRules":"71"},{"filePath":"91","messages":"92","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"71"},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"95","messages":"96","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ahc7no",{"filePath":"97","messages":"98","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"99","messages":"100","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"101","messages":"102","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"103","messages":"104","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"105","messages":"106","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"107"},{"filePath":"108","messages":"109","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"110","messages":"111","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"112","usedDeprecatedRules":"107"},{"filePath":"113","messages":"114","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"115","usedDeprecatedRules":"116"},{"filePath":"117","messages":"118","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"119","messages":"120","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"107"},{"filePath":"121","messages":"122","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"123","usedDeprecatedRules":"107"},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"107"},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"107"},{"filePath":"130","messages":"131","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"134","usedDeprecatedRules":"107"},{"filePath":"135","messages":"136","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"137","messages":"138","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"139","messages":"140","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"141","messages":"142","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\emman\\project\\src\\index.js",[],["143","144"],"C:\\Users\\emman\\project\\src\\reportWebVitals.js",[],"C:\\Users\\emman\\project\\src\\components\\App\\App.js",["145","146"],"C:\\Users\\emman\\project\\src\\utilities\\projectAPI.js",[],"C:\\Users\\emman\\project\\src\\components\\Navbar\\Navbar.js",[],"C:\\Users\\emman\\project\\src\\components\\Home\\Home.js",[],"C:\\Users\\emman\\project\\src\\components\\SearchBar\\SearchBar.js",[],"C:\\Users\\emman\\project\\src\\components\\ProductList\\ProductList.js",[],"C:\\Users\\emman\\project\\src\\components\\Product\\Product.js",[],"C:\\Users\\emman\\project\\src\\components\\Sell\\Sell.js",["147","148","149","150","151","152"],"import React, {useState } from 'react';\r\nimport { SearchBar } from '../SearchBar/SearchBar';\r\nimport { Product } from '../Product/Product'\r\nimport './Sell.css';\r\n\r\nexport const Sell = props => {\r\n const [buyNow, setBuyNow] = useState(null);\r\n const [initialPrice, setInitialPrice] = useState(null);\r\n const [duration, setDuration] = useState(null);\r\n\r\n \r\n\r\n return(\r\n <div id=\"sell-body\">\r\n <div id=\"searchbar-heading\"><h1>What item are you trying to Sell</h1></div>\r\n <div id=\"search-bar\">\r\n <SearchBar />\r\n <div id='result-container'>\r\n <div id='result-flex'>\r\n <div>\r\n <Product />\r\n </div>\r\n </div>\r\n <div id='form-flex'>\r\n <form onSubmit={()=>{}}>\r\n <label>\r\n <div className=\"input-container\">\r\n <span>Initial Ask</span><input className=\"input-field\" type=\"number\" \r\n name=\"initial-ask\" placeholder=\"Enter Amount\" value={null} onChange={null}/>\r\n </div>\r\n <div className=\"input-container\">\r\n <span>Final Ask</span><input className=\"input-field\" type=\"number\" name=\"final-ask\" \r\n placeholder=\"Enter Amoubt\" value={null} onChange={null}/>\r\n </div>\r\n <div className=\"input-container\">\r\n <span>Duration</span><input className=\"input-field\" type=\"number\" name=\"final-ask\" \r\n placeholder=\"Enter Amount\" value={null} onChange={null}/>\r\n <span>Hours</span>\r\n </div>\r\n </label>\r\n <input type=\"submit\" \r\n value=\"List Product\" id=\"login-button\"/>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}","C:\\Users\\emman\\project\\src\\components\\Browse\\Browse.js",[],"C:\\Users\\emman\\project\\src\\components\\Account\\Account.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\index.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\reportWebVitals.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\App\\App.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Footer\\Footer.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\utilities\\projectAPI.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Authenticate\\Authenticate.js",[],["153","154"],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Navbar\\Navbar.js",["155"],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\Browse\\Browse.js",["156"],"import React, { useState, useEffect } from 'react';\r\nimport { CategoryList } from '../../components/CategoryList/CategoryList';\r\nimport { ProductList } from '../../components/ProductList/ProductList';\r\nimport { retrieveData } from '../../utilities/projectAPI';\r\nimport './Browse.css';\r\n\r\nexport const Browse = () => {\r\n const [categories, setCategories] = useState([]);\r\n const [category, setCategory] = useState('');\r\n const [products, setProducts] = useState([]);\r\n \r\n const retrieveCategories = () => {\r\n retrieveData('https://tonyadi.loca.lt/categories').then(data => {\r\n setCategories(data);\r\n })\r\n }\r\n\r\n const retrieveProducts = name => {\r\n retrieveData(`https://tonyadi.loca.lt/categories/${encodeURI(name)}/products`).then(data => {\r\n setProducts(data)});\r\n }\r\n\r\n const handleClick = name => {\r\n setCategory(name);\r\n retrieveProducts(name);\r\n }\r\n\r\n // Dummy Categories to show functionality\r\n const dummyCategories = [\r\n { id: 1, \r\n name: 'iPhone 11', \r\n image_src: 'https://img.icons8.com/officel/344/iphone-x.png'\r\n },\r\n { id: 2, \r\n name: 'HP Spectre x360', \r\n image_src: 'https://img.icons8.com/officel/344/laptop.png'\r\n },\r\n { id: 3, \r\n name: 'G-Shock', \r\n image_src: 'https://img.icons8.com/officel/564/000000/apple-watch-apps.png'\r\n }\r\n ];\r\n\r\n useEffect(() => {\r\n retrieveCategories();\r\n }, [])\r\n\r\n return (\r\n <div className=\"browse-container\">\r\n <div className=\"sortBy-container\">\r\n <form className=\"filter-form\">\r\n <select className=\"cursor-pointer\" id=\"filter\" name=\"filter\">\r\n <option value=\"max\">Max Buy-Now</option>\r\n </select>\r\n {/*<input type=\"submit\"/>*/}\r\n </form>\r\n <form className=\"sortBy-form\">\r\n <select className=\"cursor-pointer\" id=\"order-by\" name=\"order-by\">\r\n <option value=\"duration\">Duration</option>\r\n <option value=\"current_ask\">Current Ask</option>\r\n <option value=\"initial_price\">Initial Ask</option>\r\n <option value=\"buy_now\">Buy Now</option>\r\n </select>\r\n {/*<input type=\"submit\"/>*/}\r\n </form>\r\n </div>\r\n <div>\r\n <h1>\r\n {!categories && 'Dummy'} Categories\r\n </h1>\r\n <CategoryList \r\n categories={categories || dummyCategories} \r\n handleClick={handleClick}\r\n />\r\n </div>\r\n <div className=\"browse-products\">\r\n {category && \r\n <ProductList \r\n heading={category}\r\n products={products}/>\r\n }\r\n </div>\r\n </div>\r\n )\r\n}","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\Landing\\Landing.js",["157","158"],"import React, { useState, useEffect } from 'react';\nimport { Link } from \"react-router-dom\";\nimport './Landing.css';\n\nimport sampleListing from '../../utilities/images/product.png';\nimport sampleSellForm from '../../utilities/images/sell-form.png';\nimport sampleBid from '../../utilities/images/bid.png';\n\nimport speed from '../../utilities/images/running.svg'\n\nexport const Landing = props => {\n const [text, setText] = useState('');\n const [index, setIndex] = useState(0);\n const [eraser, setEraser] = useState(false);\n \n const texts = ['iPhone 12', 'G-Shock', 'HP Spectre x360', 'Dell XPS 13'];\n\n useEffect(() => {\n var i = 0;\n if(text.length === 0){\n var typer = setInterval(() => {\n setText(texts[index].slice(0, i));\n if(i === texts[index].length){\n setTimeout(() => {clearInterval(typer);\n setEraser(!eraser); // find better way\n }, 4000);\n }\n i++;\n }, 150);\n }\n return () => clearInterval(typer);\n }, [index]);\n\n useEffect(() => {\n var i = texts[index].length;\n if(text.length === texts[index].length){\n var eraser = setInterval(() => {\n i--;\n setText(texts[index].slice(0, i));\n if(i === 0){\n clearInterval(eraser);\n if (index !== texts.length - 1){\n setIndex(index+1);\n }\n else{\n setIndex(0);\n }\n }\n }, 75);\n }\n return () => clearInterval(eraser);\n }, [eraser]);\n\n return(\n <div id=\"landing-container\">\n <div className=\"large-text aside-margin\">Whether you are \n trying to sell the <span className=\"text-background\">{text}\n <span className=\"cursor-blinker\"></span></span><br/> for\n a profit or buy one for the lowest price possible, we have got you covered!\n </div>\n <div className=\"aside-margin relative flex\">\n <div className=\"aside-left box\">\n <div><span>Flexible Prices</span></div>\n <h1>Built with you in mind</h1>\n <p>Listed products offer a wide range of prices but you have to be\n quick or someone else would outbid you.\n </p>\n <div><Link to=\"/register\"><button className=\"button landing-button\">Start Bidding</button></Link></div>\n </div>\n <div className=\"aside-right box\">\n <div><span>Free Market</span></div>\n <h1>Decide how much profit you make</h1>\n <p>Products can be listed with any initial ask value and buy now value,\n allowing you to price your product at whatever value you want.\n </p>\n <div><Link to=\"/register\"><button className=\"button landing-button\">Start Selling</button></Link></div>\n </div>\n </div>\n <div className=\"full-width info\">\n </div>\n <div className=\"aside-margin\">\n <h1 className=\"large-text\">How it works</h1>\n <div className=\"width-100 aside-margin\">\n <div className=\"width-two-third show-div\">\n <p>The first value you see is the initial ask, the middle value is the current ask and the\n third value is the buy now. If there are only two values then the product currently has no bids.\n If the listings duration runs out or someone equals the buy now price then the listing becomes 'Expired'.\n </p>\n </div>\n <div className=\"width-one-third show-div\">\n <img className=\"sample-listing\" src={sampleListing} alt=\"sample listing\"/>\n </div>\n </div>\n \n <div className=\"width-100 aside-margin\">\n <div className=\"width-one-third show-div\">\n <img src={sampleBid} alt=\"sample bid\" className=\"sample-listing\"/>\n </div>\n <div className=\"width-two-third show-div\">\n <p>When placing a bid, your bid must be higher than the current ask. \n If there are no bids, then it must be higher than the initial ask.\n Once you place a bid it cannot be canceled.\n Your funds are locked and will only be returned if someone outbids you.\n If your bid is the winning bid you win the product and the funds are forfeitted\n and transferred to the seller.\n </p>\n </div>\n \n </div>\n <div className=\"width-100 aside-margin\">\n <div className=\"width-two-third show-div\">\n <p>To list a product you have to list it under a category. If you cannot find\n the category you need, you can make an add category request and after review the \n category will be added. The final ask must be higher than the initial ask and\n the duration must be at least an hour.\n </p>\n </div>\n <div className=\"width-one-third show-div\">\n <img className=\"sample-sell-form\" src={sampleSellForm}\n alt=\"sample sell form\"/>\n </div>\n </div>\n <div className=\"width-100 aside-margin\">\n <div className=\"width-one-third\"> \n <i className=\"fa fa-check\"></i>\n <div><span>100% New</span></div>\n <p>All products listed on our website are subjectted to a review, if\n the product passes the necessary conditions then it is placed on the market.\n </p>\n </div>\n <div className=\"width-one-third\">\n <img src={speed} alt=\"speedometer\"/>\n <div><span>Seamless Bidding</span></div>\n <p>Funds used to bid are in-house currency which allows for fast and \n efficient bid placements. </p>\n </div>\n <div className=\"width-one-third\">\n <i className='fas fa-shield-alt'></i>\n <div><span>Safe and Secure</span></div>\n <p>Money is only transferred out of the sellers account when they verify with us \n they have mailed the product by providing us with the tracking code, which we will\n then share with you.\n </p>\n </div>\n </div>\n </div>\n </div>\n );\n}",["159","160"],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\NotFound\\NotFound.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\Home\\Home.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\Account\\Account.js",["161"],"import React, { useState, useEffect, useContext } from 'react';\r\nimport Box from '@mui/material/Box';\r\nimport TextField from '@mui/material/TextField';\r\nimport { ProductList } from '../../components/ProductList/ProductList';\r\nimport { Modal } from '../../components/Modal/Modal';\r\nimport { deleteData, retrieveData, updateData, createData } from '../../utilities/projectAPI';\r\nimport { AlertContext } from '../../components/App/App';\r\nimport './Account.css';\r\n\r\nexport const Account = props => {\r\n const [passwordDisplay, setPasswordDisplay] = useState('none');\r\n const [password, setPassword] = useState('');\r\n const [newPassword, setNewPassword] = useState('');\r\n const [authenticated, setAuthenticated] = useState(false);\r\n const [personalDetails, setPersonalDetails] = useState({});\r\n const [purchases, setPurchases] = useState([]);\r\n const [listings, setListings] = useState([]);\r\n const [bids, setBids] = useState([]);\r\n const [passwordType, setPasswordType] = useState('password');\r\n const setAlertData = useContext(AlertContext);\r\n\r\n // Manage Account\r\n\r\n const modifyDetails = () => {\r\n if(personalDetails.first_name && personalDetails.last_name){\r\n if(personalDetails.first_name.match(/^(?:[A-Za-z]+|)$/) && \r\n personalDetails.last_name.match(/^(?:[A-Za-z]+|)$/)){\r\n updateData('https://tonyadi.loca.lt/users/details', personalDetails).then(value => {\r\n if(value){\r\n setAlertData({open: true, message: 'Your modifications have been saved!', severity: 'success'});\r\n }\r\n else{\r\n setAlertData({open: true, message: 'Something went wrong. Please try again.', severity: 'warning'});\r\n }\r\n });\r\n }\r\n else{\r\n setAlertData({open: true, message: 'First name and last name can only be letters.', severity: 'warning'});\r\n }\r\n }\r\n else{\r\n setAlertData({open: true, message: 'First name and last name cannot be empty.', severity: 'warning'});\r\n }\r\n }\r\n\r\n const updatePassword = () => {\r\n const data = { email: personalDetails.email, \r\n password: password, \r\n new_password: newPassword\r\n };\r\n if(newPassword.length >= 6){\r\n updateData(`https://tonyadi.loca.lt/users/password`, data).then(value => {\r\n if(value){\r\n setAlertData({open: true, message: 'Your modifications have been saved!', severity: 'success'});\r\n setPassword(newPassword);\r\n setPasswordDisplay('none');\r\n }\r\n else{\r\n setAlertData({open: true, message: 'Something went wrong. Please try again.', severity: 'warning'});\r\n console.log('Password was not updated.');\r\n }\r\n })\r\n }\r\n else{\r\n setAlertData({open: true, message: 'Password needs to be at least 6 characters.', severity: 'warning'});\r\n }\r\n }\r\n\r\n const verifyPassword = () => {\r\n const data = {email: personalDetails.email, password: password};\r\n createData(`https://tonyadi.loca.lt/users/password`, data).then(value => {\r\n if(value){\r\n setAuthenticated(true);\r\n }\r\n else{\r\n console.log('Wrong password provided.')\r\n setAlertData({open: true, message: 'Wrong password provided', severity: 'warning'});\r\n }\r\n })\r\n }\r\n\r\n const manageAccount = e => {\r\n if(authenticated){\r\n updatePassword();\r\n }\r\n else{\r\n verifyPassword();\r\n }\r\n e.preventDefault();\r\n }\r\n\r\n // Retrieve Data\r\n\r\n const retrieveDetails = () => {\r\n retrieveData(`https://tonyadi.loca.lt/users/details`).then(data => {\r\n if(data){\r\n setPersonalDetails(data);\r\n }\r\n });\r\n }\r\n\r\n const retrieveListings = () => {\r\n retrieveData(`https://tonyadi.loca.lt/users/products?type=listing`).then(data => {\r\n setListings(data);\r\n })\r\n }\r\n\r\n const retrieveBids = () => {\r\n retrieveData(`https://tonyadi.loca.lt/users/products?type=bid`).then(data => {\r\n setBids(data);\r\n })\r\n }\r\n\r\n const retrievePurchases = () => {\r\n retrieveData(`https://tonyadi.loca.lt/users/products?type=purchase`).then(data => {\r\n setPurchases(data);\r\n })\r\n }\r\n // HANDLE FUNCTIONS\r\n\r\n const handleChange = e => {\r\n switch(e.target.name){\r\n case 'password':\r\n if(authenticated){\r\n setNewPassword(e.target.value);\r\n }\r\n else{\r\n setPassword(e.target.value);\r\n }\r\n break;\r\n default:\r\n setPersonalDetails({...personalDetails, [e.target.name]: e.target.value});\r\n }\r\n }\r\n\r\n const handleDisplay = e => {\r\n if(e.target.className === 'password-modal'){\r\n setPasswordDisplay('none');\r\n }\r\n }\r\n\r\n const handlePassword = () => {\r\n setNewPassword('');\r\n setPassword('')\r\n setPasswordDisplay('block');\r\n }\r\n\r\n const signOut = () => {\r\n deleteData(`https://tonyadi.loca.lt/users/session`).then(value => {\r\n if(value){\r\n props.setAuthenticated(false);\r\n }\r\n else{\r\n setAlertData({open: true, message: 'Something went wrong. Please try again.', severity: 'warning'});\r\n }\r\n })\r\n }\r\n\r\n const togglePassword = () => {\r\n const newPasswordType = (passwordType === 'password') ? 'text' : 'password';\r\n setPasswordType(newPasswordType);\r\n }\r\n\r\n useEffect(() => {\r\n retrieveDetails();\r\n retrieveListings();\r\n retrieveBids();\r\n retrievePurchases();\r\n document.addEventListener('mousedown', handleDisplay)\r\n }, []);\r\n\r\n // Unused for the time being\r\n const handleDelete = () => {\r\n setAlertData({open: true, message: 'This is currently unavailable', severity: 'info'});\r\n }\r\n \r\n // After 5 minutes clear users authentication\r\n useEffect(() => {\r\n var authenticationTimeout = setTimeout(() => {\r\n setAuthenticated(false);\r\n setPassword('');\r\n }, 300000);\r\n return () => clearTimeout(authenticationTimeout);\r\n }, [authenticated]);\r\n\r\n return (\r\n <div className=\"account-container\">\r\n <h1>Your Account</h1>\r\n <div>\r\n <div className=\"accmenu-container\">\r\n <div>\r\n <h2>Personal Details</h2>\r\n </div>\r\n <Box\r\n component=\"form\"\r\n sx={{\r\n '& .MuiTextField-root': { m: 1.5, \r\n marginLeft: '0',\r\n marginRight: '25px' },\r\n '& .MuiFormControl-fullWidth': {width: '95%'},\r\n width: 470,\r\n maxWidth: '100%'\r\n }}\r\n noValidate\r\n autoComplete=\"off\"\r\n >\r\n <TextField \r\n label=\"First Name\" \r\n variant=\"outlined\"\r\n onChange={handleChange}\r\n value={personalDetails.first_name}\r\n name=\"first_name\"\r\n InputLabelProps={{ shrink: true }}\r\n />\r\n <TextField\r\n label=\"Last Name\" \r\n variant=\"outlined\"\r\n onChange={handleChange}\r\n value={personalDetails.last_name}\r\n name=\"last_name\"\r\n InputLabelProps={{ shrink: true }}\r\n />\r\n <br/>\r\n <TextField \r\n disabled\r\n label=\"Email\" \r\n variant=\"outlined\"\r\n value={personalDetails.email}\r\n name=\"email\"\r\n fullWidth\r\n InputLabelProps={{ shrink: true }}\r\n />\r\n <br/>\r\n <TextField\r\n label=\"Address\" \r\n variant=\"outlined\"\r\n onChange={handleChange}\r\n value={personalDetails.address_line}\r\n name=\"address_line\"\r\n fullWidth\r\n InputLabelProps={{ shrink: true }}\r\n />\r\n <br/>\r\n <TextField\r\n label=\"City\" \r\n variant=\"outlined\"\r\n onChange={handleChange}\r\n value={personalDetails.city}\r\n name=\"city\"\r\n InputLabelProps={{ shrink: true }}\r\n />\r\n <TextField\r\n label=\"Province\" \r\n variant=\"outlined\"\r\n onChange={handleChange}\r\n value={personalDetails.province}\r\n name=\"province\"\r\n InputLabelProps={{ shrink: true }}\r\n />\r\n <br/>\r\n <TextField\r\n label=\"Postal Code\" \r\n variant=\"outlined\"\r\n onChange={handleChange}\r\n value={personalDetails.postal_code}\r\n name=\"postal_code\"\r\n InputLabelProps={{ shrink: true }}\r\n />\r\n <TextField\r\n label=\"Country\" \r\n variant=\"outlined\"\r\n onChange={handleChange}\r\n value={personalDetails.country}\r\n name=\"country\"\r\n InputLabelProps={{ shrink: true }}\r\n />\r\n </Box>\r\n <div>\r\n <button className=\"button\" onClick={modifyDetails}>\r\n Save Changes\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div className=\"accmenu-container\">\r\n <ProductList \r\n heading=\"Listings\"\r\n products={listings} \r\n disabled={true}\r\n />\r\n </div>\r\n\r\n <div className=\"accmenu-container\">\r\n <ProductList \r\n heading=\"Purchases\"\r\n products={purchases}/>\r\n </div>\r\n\r\n <div className=\"accmenu-container\">\r\n <ProductList \r\n heading='Bids'\r\n products={bids}\r\n />\r\n </div>\r\n \r\n <div className=\"accmenu-container\">\r\n <h2>Manage Account</h2>\r\n <div>\r\n <span>\r\n <b>Change Password</b>\r\n </span>\r\n <p>Once you change your current password, \r\n you will not be able to use it again.</p>\r\n <div>\r\n <button className=\"button\" onClick={handlePassword}>\r\n Change Password\r\n </button>\r\n </div>\r\n </div>\r\n <hr></hr>\r\n <div>\r\n <span>\r\n <b>Delete Account</b>\r\n </span>\r\n <p>If you delete your account, you will not be able to recover it.</p>\r\n <div>\r\n <button \r\n className=\"button delete-acc\" \r\n onClick={handleDelete}\r\n >\r\n Delete Account\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div>\r\n <button className=\"sign-out button\" onClick={signOut}>\r\n Sign Out\r\n </button>\r\n </div>\r\n\r\n <Modal \r\n modalStyle='password-modal'\r\n containerStyle='password-container'\r\n heading={`Enter ${authenticated ? 'new' : 'your'} password`}\r\n handleChange={handleChange}\r\n handleSubmit={manageAccount}\r\n display={passwordDisplay}\r\n name='password'\r\n value={authenticated ? newPassword : password} \r\n type={passwordType}\r\n placeholder='Password'\r\n children={<i className={`${passwordType === 'text' ? \r\n 'fa fa-eye' : 'fa fa-eye-slash'} \r\n password-toggle cursor-pointer`}\r\n onClick={togglePassword}/>}\r\n />\r\n </div>\r\n </div>\r\n )\r\n}","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\pages\\Sell\\Sell.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Category\\Category.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\ProductList\\ProductList.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\CategoryList\\CategoryList.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Product\\Product.js",["162"],"import React, { useState, useEffect, useContext } from 'react';\r\nimport { Link } from \"react-router-dom\";\r\nimport { createData } from '../../utilities/projectAPI';\r\nimport { AuthenticatedContext, AlertContext } from '../App/App';\r\nimport { Info } from '../Info/Info';\r\nimport { Modal } from '../Modal/Modal';\r\nimport './Product.css';\r\n\r\nexport const Product = props => {\r\n const [duration, setDuration] = useState('');\r\n const [currentAsk, setCurrentAsk] = useState(props.currentAsk);\r\n const [bid, setBid] = useState('');\r\n const [display, setDisplay] = useState('none');\r\n const authenticated = useContext(AuthenticatedContext);\r\n const setAlertData = useContext(AlertContext);\r\n\r\n const data = { id: props.id, \r\n current_ask: bid, \r\n userid: props.userId\r\n };\r\n\r\n const handleChange = e => {\r\n setBid(parseInt(e.target.value) || '');\r\n }\r\n\r\n const canBid = e => {\r\n // More cases will be added to handle archiving products.\r\n switch(e.target.name){\r\n case 'Bid':\r\n if(authenticated){\r\n props.setTransform(); // Reset product list transform style\r\n setDisplay('block');\r\n }\r\n break;\r\n default:\r\n console.log('There was a problem with the handle click function in product');\r\n }\r\n }\r\n\r\n const handleTimeout = () => {\r\n if(duration === 'Expired'){\r\n if(currentAsk){\r\n createData(`https://tonyadi.loca.lt/products/${props.id}/?action=timeout`, data)\r\n .then(value => {\r\n if(value){\r\n console.log('Product time ran out. Someone won the product.');\r\n }\r\n else{\r\n console.log('Something went wrong with handleTimeout.')\r\n }\r\n })\r\n }\r\n }\r\n }\r\n\r\n const placeBid = e => {\r\n if(bid > currentAsk && bid >= props.initialAsk && bid < props.buyNow){\r\n createData(`https://tonyadi.loca.lt/products/${props.id}/?action=bid`, data)\r\n .then(value => {\r\n if(value){\r\n setCurrentAsk(bid);\r\n setAlertData({message: 'Congratulations, you just won this item!', severity: 'success', open: true});\r\n // removed set display none from here\r\n }\r\n else{\r\n setAlertData({message: 'Bid could not be placed. Please refresh!', severity: 'warning', open: true});\r\n }\r\n });\r\n }\r\n else if(bid === props.buyNow){\r\n createData(`https://tonyadi.loca.lt/products/${props.id}/?action=sell`, data)\r\n .then(value => {\r\n if(value){\r\n setCurrentAsk(bid);\r\n setAlertData({message: 'Congratulations, you just won this item!', severity: 'success', open: true});\r\n }\r\n else{\r\n setAlertData({message: 'Bid could not be placed. Please refresh!', severity: 'warning', open: true});\r\n }\r\n })\r\n }\r\n else{\r\n setAlertData({message: 'Bid is lower than the current ask or more than the buy now price.',\r\n severity: 'warning', open: true});\r\n }\r\n e.preventDefault();\r\n setDisplay('none'); \r\n }\r\n\r\n // utils\r\n const isPlural = item => {\r\n return (item !== 1) ? 's' : '';\r\n }\r\n \r\n // Calculates the duration\r\n useEffect(()=> {\r\n const countDownDate = new Date(props.duration).getTime();\r\n const durationFunction = () => {\r\n const now = new Date().getTime();\r\n // Adds a second delay so timeout function is called at the right time\r\n const distance = countDownDate - now + 1000;\r\n // Checks if the duration has run out or if the product has been bought\r\n if(distance > 0 && (currentAsk !== props.buyNow)) {\r\n const days = Math.floor(distance / (1000 * 60 * 60 * 24));\r\n const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\r\n const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));\r\n const seconds = Math.floor((distance % (1000 * 60)) / 1000);\r\n if(days > 0){\r\n setDuration(`${days} Day${isPlural(days)} ${hours ? \r\n `${hours} Hour${isPlural(hours)}` : ''}`);\r\n }\r\n else if(hours > 0){\r\n setDuration(`${hours} Hour${isPlural(hours)} ${minutes ? \r\n `${minutes} Minute${isPlural(minutes)}` : ''}`);\r\n }\r\n else if(minutes > 0){\r\n setDuration(`${minutes} Minute${isPlural(minutes)} ${seconds ? \r\n `${seconds} Second${isPlural(seconds)}` : ''}`);\r\n }\r\n else if(seconds > 0){\r\n setDuration(`${seconds} Second${isPlural(seconds)}`);\r\n }\r\n }\r\n else if(distance === 0){\r\n handleTimeout();\r\n setDuration('Expired');\r\n clearInterval(durationInterval); \r\n }\r\n else{\r\n setDuration('Expired')\r\n clearInterval(durationInterval); \r\n }\r\n };\r\n durationFunction();\r\n var durationInterval = setInterval(durationFunction, 1000); \r\n return () => clearInterval(durationInterval);\r\n }, [props.duration, currentAsk, props.buyNow]); // revise\r\n\r\n const handleDisplay = e => {\r\n if(e.target.className === 'bid-container'){\r\n setDisplay('none');\r\n }\r\n }\r\n \r\n useEffect(() => {\r\n document.addEventListener('mousedown', handleDisplay);\r\n }, []);\r\n\r\n let details = [ {infoStyle: 'product-name', info: props.name},\r\n {info: `$${props.initialAsk}`},\r\n {info: (currentAsk !== 0) && `$${currentAsk}`},\r\n {containerStyle: 'product-buynow', info: `$${props.buyNow}`},\r\n {info: duration}]\r\n return(\r\n <div className=\"product-container\">\r\n <div className=\"card-container\">\r\n <div className=\"card\">\r\n <div className=\"image-container\">\r\n <img className=\"product-image\" \r\n src={props.imageSrc} \r\n alt={`The ${props.name} being listed`}\r\n />\r\n </div>\r\n {details.map(detail => \r\n <Info \r\n key={detail.info}\r\n info={detail.info}\r\n containerStyle={detail.containerStyle}\r\n infoStyle={detail.infoStyle}/>\r\n )}\r\n {(duration !=='Expired' && !props.disabled) && \r\n <Link \r\n onClick={canBid}\r\n className=\"bid-button\"\r\n name=\"Bid\"\r\n to={!authenticated ? '/login' : '/'}>\r\n Bid\r\n </Link>\r\n }\r\n </div>\r\n </div>\r\n \r\n <Modal \r\n modalStyle='bid-container'\r\n containerStyle='form-container'\r\n heading='Place Bid'\r\n handleChange={handleChange}\r\n handleSubmit={placeBid}\r\n display={display}\r\n name='Bid'\r\n value={bid}\r\n type='number'\r\n submitValue={bid === props.buyNow ? 'Buy Now' : 'Bid'}\r\n placeholder={`Enter a value higher than $${(currentAsk === 0) ? \r\n props.initialAsk : currentAsk}`}\r\n />\r\n </div>\r\n );\r\n}","C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\SearchBar\\SearchBar.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Intro\\Intro.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Info\\Info.js",[],"C:\\Users\\emman\\OneDrive\\Documents\\GitHub\\Augeo\\src\\components\\Modal\\Modal.js",[],{"ruleId":"163","replacedBy":"164"},{"ruleId":"165","replacedBy":"166"},{"ruleId":"167","severity":1,"message":"168","line":1,"column":27,"nodeType":"169","messageId":"170","endLine":1,"endColumn":36},{"ruleId":"167","severity":1,"message":"171","line":17,"column":10,"nodeType":"169","messageId":"170","endLine":17,"endColumn":17},{"ruleId":"167","severity":1,"message":"172","line":7,"column":12,"nodeType":"169","messageId":"170","endLine":7,"endColumn":18},{"ruleId":"167","severity":1,"message":"173","line":7,"column":20,"nodeType":"169","messageId":"170","endLine":7,"endColumn":29},{"ruleId":"167","severity":1,"message":"174","line":8,"column":12,"nodeType":"169","messageId":"170","endLine":8,"endColumn":24},{"ruleId":"167","severity":1,"message":"175","line":8,"column":26,"nodeType":"169","messageId":"170","endLine":8,"endColumn":41},{"ruleId":"167","severity":1,"message":"176","line":9,"column":12,"nodeType":"169","messageId":"170","endLine":9,"endColumn":20},{"ruleId":"167","severity":1,"message":"177","line":9,"column":22,"nodeType":"169","messageId":"170","endLine":9,"endColumn":33},{"ruleId":"163","replacedBy":"178"},{"ruleId":"165","replacedBy":"179"},{"ruleId":"180","severity":1,"message":"181","line":24,"column":8,"nodeType":"182","endLine":24,"endColumn":10,"suggestions":"183"},{"ruleId":"180","severity":1,"message":"184","line":54,"column":8,"nodeType":"182","endLine":54,"endColumn":10,"suggestions":"185"},{"ruleId":"180","severity":1,"message":"186","line":32,"column":8,"nodeType":"182","endLine":32,"endColumn":15,"suggestions":"187"},{"ruleId":"180","severity":1,"message":"188","line":52,"column":8,"nodeType":"182","endLine":52,"endColumn":16,"suggestions":"189"},{"ruleId":"163","replacedBy":"190"},{"ruleId":"165","replacedBy":"191"},{"ruleId":"167","severity":1,"message":"192","line":6,"column":48,"nodeType":"169","messageId":"170","endLine":6,"endColumn":58},{"ruleId":"180","severity":1,"message":"193","line":137,"column":9,"nodeType":"182","endLine":137,"endColumn":51,"suggestions":"194"},"no-native-reassign",["195"],"no-negated-in-lhs",["196"],"no-unused-vars","'useEffect' is defined but never used.","Identifier","unusedVar","'account' is assigned a value but never used.","'buyNow' is assigned a value but never used.","'setBuyNow' is assigned a value but never used.","'initialPrice' is assigned a value but never used.","'setInitialPrice' is assigned a value but never used.","'duration' is assigned a value but never used.","'setDuration' is assigned a value but never used.",["195"],["196"],"react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'handleMobileMenu'. Either include it or remove the dependency array.","ArrayExpression",["197"],"React Hook useEffect has a missing dependency: 'categories'. Either include it or remove the dependency array.",["198"],"React Hook useEffect has missing dependencies: 'eraser', 'text.length', and 'texts'. Either include them or remove the dependency array. You can also do a functional update 'setEraser(e => ...)' if you only need 'eraser' in the 'setEraser' call.",["199"],"React Hook useEffect has missing dependencies: 'index', 'text.length', and 'texts'. Either include them or remove the dependency array. You can also replace multiple useState variables with useReducer if 'setText' needs the current value of 'index'.",["200"],["195"],["196"],"'createData' is defined but never used.","React Hook useEffect has a missing dependency: 'handleTimeout'. Either include it or remove the dependency array.",["201"],"no-global-assign","no-unsafe-negation",{"desc":"202","fix":"203"},{"desc":"204","fix":"205"},{"desc":"206","fix":"207"},{"desc":"206","fix":"208"},{"desc":"209","fix":"210"},"Update the dependencies array to be: [handleMobileMenu]",{"range":"211","text":"212"},"Update the dependencies array to be: [categories]",{"range":"213","text":"214"},"Update the dependencies array to be: [eraser, index, text.length, texts]",{"range":"215","text":"216"},{"range":"217","text":"216"},"Update the dependencies array to be: [props.duration, currentAsk, props.buyNow, handleTimeout]",{"range":"218","text":"219"},[880,882],"[handleMobileMenu]",[1840,1842],"[categories]",[1101,1108],"[eraser, index, text.length, texts]",[1759,1767],[5735,5777],"[props.duration, currentAsk, props.buyNow, handleTimeout]"]