-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 19.6 KB
/
.eslintcache
1
[{"/Users/carryex/Documents/web/clones/amazon-clone/src/reportWebVitals.js":"1","/Users/carryex/Documents/web/clones/amazon-clone/src/index.js":"2","/Users/carryex/Documents/web/clones/amazon-clone/src/App.js":"3","/Users/carryex/Documents/web/clones/amazon-clone/src/pages/home/Home.jsx":"4","/Users/carryex/Documents/web/clones/amazon-clone/src/components/header/Header.jsx":"5","/Users/carryex/Documents/web/clones/amazon-clone/src/components/product/Product.jsx":"6","/Users/carryex/Documents/web/clones/amazon-clone/src/redux/reducer.js":"7","/Users/carryex/Documents/web/clones/amazon-clone/src/redux/StateProvider.js":"8","/Users/carryex/Documents/web/clones/amazon-clone/src/firebase/firebase.js":"9","/Users/carryex/Documents/web/clones/amazon-clone/src/pages/login/Login.jsx":"10","/Users/carryex/Documents/web/clones/amazon-clone/src/components/subtotal/Subtotal.jsx":"11","/Users/carryex/Documents/web/clones/amazon-clone/src/pages/payment/Payment.jsx":"12","/Users/carryex/Documents/web/clones/amazon-clone/src/components/checkoutProduct/CheckoutProduct.jsx":"13","/Users/carryex/Documents/web/clones/amazon-clone/src/pages/checkout/Checkout.jsx":"14","/Users/carryex/Documents/web/clones/amazon-clone/src/axios/axios.js":"15","/Users/carryex/Documents/web/clones/amazon-clone/src/pages/orders/Orders.jsx":"16","/Users/carryex/Documents/web/clones/amazon-clone/src/components/order/Order.jsx":"17"},{"size":362,"mtime":1609838337345,"results":"18","hashOfConfig":"19"},{"size":422,"mtime":1609853204062,"results":"20","hashOfConfig":"19"},{"size":1830,"mtime":1609884624063,"results":"21","hashOfConfig":"19"},{"size":2396,"mtime":1609852025069,"results":"22","hashOfConfig":"19"},{"size":1879,"mtime":1609858800137,"results":"23","hashOfConfig":"19"},{"size":1014,"mtime":1609857770670,"results":"24","hashOfConfig":"19"},{"size":1038,"mtime":1609866320736,"results":"25","hashOfConfig":"19"},{"size":472,"mtime":1609853097951,"results":"26","hashOfConfig":"19"},{"size":471,"mtime":1609854433452,"results":"27","hashOfConfig":"19"},{"size":1979,"mtime":1609856300546,"results":"28","hashOfConfig":"19"},{"size":1099,"mtime":1609868143491,"results":"29","hashOfConfig":"19"},{"size":4176,"mtime":1609885267762,"results":"30","hashOfConfig":"19"},{"size":1018,"mtime":1609858103415,"results":"31","hashOfConfig":"19"},{"size":1095,"mtime":1609858605571,"results":"32","hashOfConfig":"19"},{"size":259,"mtime":1609948788716,"results":"33","hashOfConfig":"19"},{"size":951,"mtime":1609944523473,"results":"34","hashOfConfig":"19"},{"size":1002,"mtime":1609944631559,"results":"35","hashOfConfig":"19"},{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"19m2p4d",{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"40"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"45"},{"filePath":"46","messages":"47","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"48","usedDeprecatedRules":"40"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"51","usedDeprecatedRules":"52"},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"40"},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"57"},{"filePath":"58","messages":"59","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"60","messages":"61","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"62","messages":"63","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"64","messages":"65","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"66","usedDeprecatedRules":"40"},{"filePath":"67","messages":"68","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"69","usedDeprecatedRules":"45"},{"filePath":"70","messages":"71","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"72","usedDeprecatedRules":"52"},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"75","messages":"76","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"77","usedDeprecatedRules":"40"},{"filePath":"78","messages":"79","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/carryex/Documents/web/clones/amazon-clone/src/reportWebVitals.js",[],"/Users/carryex/Documents/web/clones/amazon-clone/src/index.js",[],["80","81"],"/Users/carryex/Documents/web/clones/amazon-clone/src/App.js",["82","83"],"/Users/carryex/Documents/web/clones/amazon-clone/src/pages/home/Home.jsx",[],["84","85"],"/Users/carryex/Documents/web/clones/amazon-clone/src/components/header/Header.jsx",["86","87"],"import React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nimport SearchIcon from \"@material-ui/icons/Search\";\nimport ShoppingBasketIcon from \"@material-ui/icons/ShoppingBasket\";\n\nimport { useStateValue } from \"../../redux/StateProvider\";\nimport { auth } from \"../../firebase/firebase\";\n\nimport \"./Header.styles.scss\";\n\nconst Header = () => {\n const [{ basket, user }, dispatch] = useStateValue();\n\n const handleAuthenticaton = () => {\n if (user) {\n auth.signOut();\n }\n };\n return (\n <div className=\"header\">\n <Link to=\"/\">\n <img\n className=\"logo\"\n src=\"http://pngimg.com/uploads/amazon/amazon_PNG11.png\"\n />\n </Link>\n\n <div className=\"search\">\n <input className=\"searchInput\" type=\"text\" />\n <SearchIcon className=\"searchIcon\" />\n </div>\n\n <div className=\"nav\">\n <Link to={!user ? \"/login\" : \"/\"}>\n <div onClick={handleAuthenticaton} className=\"option\">\n <span className=\"optionLineOne\">\n Hello {!user ? \"Guest\" : user.email}\n </span>\n <span className=\"optionLineTwo\">\n {user ? \"Sign Out\" : \"Sign In\"}\n </span>\n </div>\n </Link>\n\n <Link to=\"/orders\">\n <div className=\"option\">\n <span className=\"optionLineOne\">Returns</span>\n <span className=\"optionLineTwo\">& Orders</span>\n </div>\n </Link>\n\n <div className=\"option\">\n <span className=\"optionLineOne\">Your</span>\n <span className=\"optionLineTwo\">Prime</span>\n </div>\n\n <Link to=\"/checkout\">\n <div className=\"optionBasket\">\n <ShoppingBasketIcon />\n <span className=\"optionLineTwo basketCount\">{basket?.length}</span>\n </div>\n </Link>\n </div>\n </div>\n );\n};\n\nexport default Header;","/Users/carryex/Documents/web/clones/amazon-clone/src/components/product/Product.jsx",["88"],"import React from \"react\";\n\nimport { useStateValue } from \"../../redux/StateProvider\";\n\nimport \"./Product.styles.scss\";\n\nconst Product = ({ id, title, image, price, rating }) => {\n const [{ basket }, dispatch] = useStateValue();\n\n const addToBasket = () => {\n // dispatch the item into the data layer\n dispatch({\n type: \"ADD_TO_BASKET\",\n item: {\n id: id,\n title: title,\n image: image,\n price: price,\n rating: rating,\n },\n });\n };\n\n return (\n <div className=\"product\">\n <div className=\"info\">\n <p>{title}</p>\n <p className=\"price\">\n <small>$</small>\n <strong>{price}</strong>\n </p>\n <div className=\"rating\">\n {Array(rating)\n .fill()\n .map((_, i) => (\n <p key={i}>🌟</p>\n ))}\n </div>\n </div>\n\n <img src={image} alt=\"\" />\n\n <button onClick={addToBasket}>Add to Basket</button>\n </div>\n );\n};\n\nexport default Product;\n",["89","90"],"/Users/carryex/Documents/web/clones/amazon-clone/src/redux/reducer.js",[],"/Users/carryex/Documents/web/clones/amazon-clone/src/redux/StateProvider.js",[],["91","92"],"/Users/carryex/Documents/web/clones/amazon-clone/src/firebase/firebase.js",[],"/Users/carryex/Documents/web/clones/amazon-clone/src/pages/login/Login.jsx",["93"],"/Users/carryex/Documents/web/clones/amazon-clone/src/components/subtotal/Subtotal.jsx",["94"],"/Users/carryex/Documents/web/clones/amazon-clone/src/pages/payment/Payment.jsx",["95"],"import React, { useState, useEffect } from \"react\";\nimport { Link, useHistory } from \"react-router-dom\";\nimport CurrencyFormat from \"react-currency-format\";\nimport { db } from \"../../firebase/firebase\";\n\nimport { CardElement, useStripe, useElements } from \"@stripe/react-stripe-js\";\n\nimport { useStateValue } from \"../../redux/StateProvider\";\nimport { getBasketTotal } from \"../../redux/reducer\";\nimport axios from \"../../axios/axios\";\n\nimport CheckoutProduct from \"../../components/checkoutProduct/CheckoutProduct\";\n\nimport \"./Payment.styles.scss\";\n\nconst Payment = () => {\n const [{ basket, user }, dispatch] = useStateValue();\n const history = useHistory();\n const stripe = useStripe();\n const elements = useElements();\n\n const [succeeded, setSucceeded] = useState(false);\n const [processing, setProcessing] = useState(\"\");\n const [error, setError] = useState(null);\n const [disabled, setDisabled] = useState(true);\n const [clientSecret, setClientSecret] = useState(true);\n\n useEffect(() => {\n const getClientSecret = async () => {\n const response = await axios({\n method: \"post\",\n url: `/payments/create?total=${getBasketTotal(basket) * 100}`,\n });\n setClientSecret(response.data.clientSecret);\n };\n getClientSecret();\n }, [basket]);\n\n console.log(\"The secret is >>> \", clientSecret);\n\n const handleSubmit = async (event) => {\n event.preventDefault();\n setProcessing(true);\n\n const payload = await stripe\n .confirmCardPayment(clientSecret, {\n payment_method: {\n card: elements.getElement(CardElement),\n },\n })\n .then(({ paymentIntent }) => {\n db.collection(\"users\")\n .doc(user?.uid)\n .collection(\"orders\")\n .doc(paymentIntent.id)\n .set({\n basket: basket,\n amount: paymentIntent.amount,\n created: paymentIntent.created,\n });\n\n setSucceeded(true);\n setError(null);\n setProcessing(false);\n\n dispatch({\n type: \"EMPTY_BASKET\",\n });\n\n history.replace(\"/orders\");\n });\n\n // const payload = await stripe\n };\n\n const handleChange = (event) => {\n setDisabled(event.empty);\n setError(event.error ? event.error.message : \"\");\n };\n\n return (\n <div className=\"payment\">\n <div className=\"container\">\n <h1>\n Checkout (<Link to=\"/checkout\">{basket?.length} items</Link>)\n </h1>\n\n <div className=\"section\">\n <div className=\"title\">\n <h3>Delivery Address</h3>\n </div>\n <div className=\"address\">\n <p>{user?.email}</p>\n <p>9 Lubynka street</p>\n <p>Moscow</p>\n </div>\n </div>\n\n <div className=\"section\">\n <div className=\"title\">\n <h3>Review items and delivery</h3>\n </div>\n <div className=\"items\">\n {basket.map((item) => (\n <CheckoutProduct\n id={item.id}\n title={item.title}\n image={item.image}\n price={item.price}\n rating={item.rating}\n />\n ))}\n </div>\n </div>\n\n <div className=\"section\">\n <div className=\"title\">\n <h3>Payment Method</h3>\n </div>\n\n <div className=\"details\">\n <form onSubmit={handleSubmit}>\n <CardElement onChange={handleChange} />\n <div className=\"priceContainer\">\n <CurrencyFormat\n renderText={(value) => <h3>Order Total: {value}</h3>}\n decimalScale={2}\n value={getBasketTotal(basket)}\n displayType={\"text\"}\n thousandSeparator={true}\n prefix={\"$\"}\n />\n <button disabled={processing || disabled || succeeded}>\n <span>{processing ? <p>Processing</p> : \"Buy Now\"}</span>\n </button>\n </div>\n {error && <div>{error}</div>}\n </form>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default Payment;\n","/Users/carryex/Documents/web/clones/amazon-clone/src/components/checkoutProduct/CheckoutProduct.jsx",["96","97"],"import React from \"react\";\n\nimport { useStateValue } from \"../../redux/StateProvider\";\n\nimport \"./CheckoutProduct.styles.scss\";\n\nconst CheckoutProduct = ({ id, image, title, price, rating, hideButton }) => {\n const [{ basket }, dispatch] = useStateValue();\n\n const removeFromBasket = () => {\n // remove the item from the basket\n dispatch({\n type: \"REMOVE_FROM_BASKET\",\n id: id,\n });\n };\n\n return (\n <div className=\"checkoutProduct\">\n <img className=\"image\" src={image} />\n\n <div className=\"info\">\n <p className=\"title\">{title}</p>\n <p className=\"price\">\n <small>$</small>\n <strong>{price}</strong>\n </p>\n <div className=\"rating\">\n {Array(rating)\n .fill()\n .map((_, i) => (\n <p>🌟</p>\n ))}\n </div>\n {!hideButton && (\n <button onClick={removeFromBasket}>Remove from Basket</button>\n )}\n </div>\n </div>\n );\n};\n\nexport default CheckoutProduct;\n","/Users/carryex/Documents/web/clones/amazon-clone/src/pages/checkout/Checkout.jsx",["98"],"import React from \"react\";\n\nimport { useStateValue } from \"../../redux/StateProvider\";\n\nimport CheckoutProduct from \"../../components/checkoutProduct/CheckoutProduct\";\nimport Subtotal from \"../../components/subtotal/Subtotal\";\n\nimport \"./Checkout.styles.scss\";\n\nconst Checkout = () => {\n const [{ basket, user }, dispatch] = useStateValue();\n\n return (\n <div className=\"checkout\">\n <div className=\"left\">\n <img\n className=\"ad\"\n src=\"https://images-na.ssl-images-amazon.com/images/G/02/UK_CCMP/TM/OCC_Amazon1._CB423492668_.jpg\"\n alt=\"\"\n />\n\n <div>\n <h3>Hello, {user?.email}</h3>\n <h2 className=\"title\">Your shopping Basket</h2>\n\n {basket.map((item) => (\n <CheckoutProduct\n id={item.id}\n title={item.title}\n image={item.image}\n price={item.price}\n rating={item.rating}\n />\n ))}\n </div>\n </div>\n\n <div className=\"right\">\n <Subtotal />\n </div>\n </div>\n );\n};\n\nexport default Checkout;\n","/Users/carryex/Documents/web/clones/amazon-clone/src/axios/axios.js",[],"/Users/carryex/Documents/web/clones/amazon-clone/src/pages/orders/Orders.jsx",["99","100"],"import React, { useState, useEffect } from \"react\";\n\nimport { db } from \"../../firebase/firebase\";\nimport { useStateValue } from \"../../redux/StateProvider\";\n\nimport Order from \"../../components/order/Order\";\n\nimport \"./Orders.styles.scss\";\n\nconst Orders = () => {\n const [{ bakset, user }, dispatch] = useStateValue();\n const [orders, setOrders] = useState([]);\n useEffect(() => {\n if (user) {\n db.collection(\"users\")\n .doc(user?.uid)\n .collection(\"orders\")\n .orderBy(\"created\", \"desc\")\n .onSnapshot((snapshot) =>\n setOrders(\n snapshot.docs.map((doc) => ({\n id: doc.id,\n data: doc.data(),\n }))\n )\n );\n } else {\n setOrders([]);\n }\n }, [user]);\n return (\n <div className=\"orders\">\n <h1>Your orders</h1>\n {orders?.map((order) => (\n <Order order={order} />\n ))}\n </div>\n );\n};\nexport default Orders;\n","/Users/carryex/Documents/web/clones/amazon-clone/src/components/order/Order.jsx",[],{"ruleId":"101","replacedBy":"102"},{"ruleId":"103","replacedBy":"104"},{"ruleId":"105","severity":1,"message":"106","line":24,"column":10,"nodeType":"107","messageId":"108","endLine":24,"endColumn":12},{"ruleId":"109","severity":1,"message":"110","line":41,"column":6,"nodeType":"111","endLine":41,"endColumn":8,"suggestions":"112"},{"ruleId":"101","replacedBy":"113"},{"ruleId":"103","replacedBy":"114"},{"ruleId":"115","severity":1,"message":"116","line":13,"column":28,"nodeType":"117","messageId":"118","endLine":13,"endColumn":36},{"ruleId":"119","severity":1,"message":"120","line":23,"column":9,"nodeType":"121","endLine":26,"endColumn":11},{"ruleId":"115","severity":1,"message":"122","line":8,"column":12,"nodeType":"117","messageId":"118","endLine":8,"endColumn":18},{"ruleId":"101","replacedBy":"123"},{"ruleId":"103","replacedBy":"124"},{"ruleId":"101","replacedBy":"125"},{"ruleId":"103","replacedBy":"126"},{"ruleId":"119","severity":1,"message":"120","line":39,"column":9,"nodeType":"121","endLine":42,"endColumn":11},{"ruleId":"115","severity":1,"message":"116","line":12,"column":22,"nodeType":"117","messageId":"118","endLine":12,"endColumn":30},{"ruleId":"115","severity":1,"message":"127","line":45,"column":11,"nodeType":"117","messageId":"118","endLine":45,"endColumn":18},{"ruleId":"115","severity":1,"message":"122","line":8,"column":12,"nodeType":"117","messageId":"118","endLine":8,"endColumn":18},{"ruleId":"119","severity":1,"message":"120","line":20,"column":7,"nodeType":"121","endLine":20,"endColumn":44},{"ruleId":"115","severity":1,"message":"116","line":11,"column":28,"nodeType":"117","messageId":"118","endLine":11,"endColumn":36},{"ruleId":"115","severity":1,"message":"128","line":11,"column":12,"nodeType":"117","messageId":"118","endLine":11,"endColumn":18},{"ruleId":"115","severity":1,"message":"116","line":11,"column":28,"nodeType":"117","messageId":"118","endLine":11,"endColumn":36},"no-native-reassign",["129"],"no-negated-in-lhs",["130"],"no-empty-pattern","Unexpected empty object pattern.","ObjectPattern","unexpected","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array.","ArrayExpression",["131"],["129"],["130"],"no-unused-vars","'dispatch' is assigned a value but never used.","Identifier","unusedVar","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement","'basket' is assigned a value but never used.",["129"],["130"],["129"],["130"],"'payload' is assigned a value but never used.","'bakset' is assigned a value but never used.","no-global-assign","no-unsafe-negation",{"desc":"132","fix":"133"},"Update the dependencies array to be: [dispatch]",{"range":"134","text":"135"},[1154,1156],"[dispatch]"]