-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintcache
1 lines (1 loc) · 21.3 KB
/
.eslintcache
1
[{"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\App.js":"1","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Header\\Header.js":"2","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Home\\Home.js":"3","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Product\\Product.js":"4","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\index.js":"5","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Checkout\\Checkout.js":"6","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Subtotal\\Subtotal.js":"7","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\DataLayer.js":"8","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\reducer.js":"9","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\reportWebVitals.js":"10","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\CheckoutProduct\\CheckoutProduct.js":"11","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Login\\Login.js":"12","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\firebaseConfig.js":"13","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Payment\\Payment.js":"14","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\axios.js":"15","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Orders\\Orders.js":"16","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Order\\Order.js":"17"},{"size":1833,"mtime":1606651191393,"results":"18","hashOfConfig":"19"},{"size":2032,"mtime":1606985261326,"results":"20","hashOfConfig":"19"},{"size":2609,"mtime":1606295900292,"results":"21","hashOfConfig":"19"},{"size":1045,"mtime":1606371562915,"results":"22","hashOfConfig":"19"},{"size":673,"mtime":1606319048484,"results":"23","hashOfConfig":"19"},{"size":1157,"mtime":1606473819795,"results":"24","hashOfConfig":"19"},{"size":1066,"mtime":1606497651526,"results":"25","hashOfConfig":"19"},{"size":427,"mtime":1606319017995,"results":"26","hashOfConfig":"19"},{"size":1094,"mtime":1606650652078,"results":"27","hashOfConfig":"19"},{"size":362,"mtime":499162500000,"results":"28","hashOfConfig":"19"},{"size":1079,"mtime":1606987404367,"results":"29","hashOfConfig":"19"},{"size":2279,"mtime":1606470923341,"results":"30","hashOfConfig":"19"},{"size":617,"mtime":1606654900388,"results":"31","hashOfConfig":"19"},{"size":4475,"mtime":1606656463821,"results":"32","hashOfConfig":"19"},{"size":191,"mtime":1606644991545,"results":"33","hashOfConfig":"19"},{"size":1182,"mtime":1606718018924,"results":"34","hashOfConfig":"19"},{"size":1165,"mtime":1606984988836,"results":"35","hashOfConfig":"19"},{"filePath":"36","messages":"37","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"p9owzx",{"filePath":"38","messages":"39","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"40","usedDeprecatedRules":"41"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"47"},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"41"},{"filePath":"50","messages":"51","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"52","usedDeprecatedRules":"44"},{"filePath":"53","messages":"54","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"63"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"41"},{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"68","messages":"69","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"70","usedDeprecatedRules":"41"},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"75"},{"filePath":"76","messages":"77","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\App.js",["78","79","80"],"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Header\\Header.js",["81"],"import React from \"react\";\r\nimport \"./Header.css\";\r\nimport SearchIcon from \"@material-ui/icons/Search\";\r\nimport ShoppingCartIcon from \"@material-ui/icons/ShoppingCart\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { useDataLayerValue } from \"../../DataLayer\";\r\nimport firebase from 'firebase/app'\r\n\r\nconst Header = () => {\r\n const [{basket, user} , dispatch] = useDataLayerValue();\r\n\r\n const handleAuthentication = () => {\r\n if (user) {\r\n firebase.auth().signOut();\r\n }\r\n }\r\n return (\r\n <div className=\"header\">\r\n <Link to=\"/\">\r\n <img\r\n className=\"header__logo\"\r\n src=\"https://1079life.com/wp-content/uploads/2018/12/amazon_PNG11.png\"\r\n alt=\"amazon logo\"\r\n />\r\n </Link>\r\n\r\n <div className=\"header__search\">\r\n <input className=\"header__searchInput\" type=\"text\" />\r\n <SearchIcon className=\"search__icon\" />\r\n </div>\r\n\r\n <div className=\"header__nav\">\r\n <Link to={!user && \"/login\"}>\r\n <div onClick={handleAuthentication} className=\"header__option\">\r\n <span className=\"header__optionLineOne\">Hello, { user ? user.email : 'Guest'}</span>\r\n <span className=\"header__optionLineTwo\">{user ? \"Sign Out\" : \"Sign In\"}</span>\r\n </div>\r\n </Link>\r\n <Link to={user ? \"/orders\" : \"/login\"}>\r\n <div className=\"header__option\">\r\n <span className=\"header__optionLineOne\">Returns</span>\r\n <span className=\"header__optionLineTwo\">& Orders</span>\r\n </div>\r\n </Link>\r\n <div className=\"header__option\">\r\n <span className=\"header__optionLineOne\">Your</span>\r\n <span className=\"header__optionLineTwo\">Prime</span>\r\n </div>\r\n <Link to=\"/checkout\">\r\n <div className=\"header__optionBasket\">\r\n <ShoppingCartIcon />\r\n <span className=\"header__optionLineTwo header_basketCount\">{basket.length}</span>\r\n </div>\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Header;\r\n",["82","83"],"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Home\\Home.js",[],["84","85"],"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Product\\Product.js",["86"],"import React from \"react\";\r\nimport \"./Product.css\";\r\nimport { useDataLayerValue } from \"../../DataLayer\";\r\n\r\nconst Product = ({ id, title, image, price, rating}) => {\r\n \r\n const [{basket} , dispatch] = useDataLayerValue();\r\n\r\n const addToBasket = () => {\r\n // dispatch the item to the data layer\r\n dispatch({\r\n type: \"ADD_TO_BASKET\",\r\n item: {\r\n id: id,\r\n title: title,\r\n image: image,\r\n price: price,\r\n rating: rating,\r\n },\r\n });\r\n };\r\n\r\n return (\r\n <div className=\"product\">\r\n <div className=\"product__info\">\r\n <p>{title}</p>\r\n <p className=\"product__price\">\r\n <small>$</small>\r\n <strong>{price}</strong>\r\n </p>\r\n <div className=\"product__rating\">\r\n {Array(rating).fill().map((_,i) => (\r\n <p>⭐</p>\r\n ))}\r\n </div>\r\n </div>\r\n\r\n <img src={image} alt=\"lean-startup\" />\r\n\r\n <button onClick={addToBasket}>Add to Basket</button>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Product;\r\n","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\index.js",[],"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Checkout\\Checkout.js",["87"],"import React from \"react\";\r\nimport CheckoutProduct from \"../CheckoutProduct/CheckoutProduct\";\r\nimport Subtotal from \"../Subtotal/Subtotal\";\r\nimport \"./Checkout.css\";\r\nimport { useDataLayerValue } from \"../../DataLayer\";\r\n\r\nconst Checkout = () => {\r\n const [{ basket, user }, dispatch] = useDataLayerValue();\r\n\r\n return (\r\n <div className=\"checkout\">\r\n <div className=\"checkout__left\">\r\n <img\r\n className=\"checkout__ad\"\r\n src=\"https://images-na.ssl-images-amazon.com/images/G/02/UK_CCMP/TM/OCC_Amazon1._CB423492668_.jpg\"\r\n alt=\"checkout ad\"\r\n />\r\n <div>\r\n <h3>Hello, {user ? user.email : 'Guest'}</h3>\r\n <h2 className=\"checkout__title\">Your shopping basket</h2>\r\n {basket.map((item) => (\r\n <CheckoutProduct\r\n id={item.id}\r\n image={item.image}\r\n rating={item.rating}\r\n price={item.price}\r\n title={item.title}\r\n />\r\n ))}\r\n </div>\r\n </div>\r\n <div className=\"checkout__right\">\r\n <Subtotal />\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Checkout;\r\n","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Subtotal\\Subtotal.js",["88"],"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\DataLayer.js",[],"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\reducer.js",[],"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\reportWebVitals.js",[],"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\CheckoutProduct\\CheckoutProduct.js",["89"],"import React from \"react\";\r\nimport \"./CheckoutProduct.css\";\r\nimport { useDataLayerValue } from \"../../DataLayer\";\r\n\r\nconst CheckoutProduct = ({ id, image, title, rating, price, hideButton }) => {\r\n\r\n const [{ basket }, dispatch] = useDataLayerValue();\r\n\r\n const removeFromBasket = () => {\r\n dispatch({\r\n type:\"REMOVE_FROM_BASKET\",\r\n id: id,\r\n })\r\n }\r\n return (\r\n <div className=\"checkoutProduct\">\r\n\r\n <img className=\"checkoutProduct__image\" src={image} alt=\"\" />\r\n\r\n <div className=\"checkoutProduct__info\">\r\n <p className=\"checkoutProduct__title\">{title}</p>\r\n <p className=\"checkoutProduct_price\">\r\n <small>$</small>\r\n <strong>{price}</strong>\r\n </p>\r\n <div className=\"checoutProduct__rating\">\r\n {Array(rating).fill().map((_,i) => (\r\n <p>⭐</p>\r\n ))}\r\n </div>\r\n {!hideButton && (\r\n <button onClick={removeFromBasket}>Remove from basket</button>\r\n )}\r\n </div>\r\n \r\n </div>\r\n );\r\n};\r\n\r\nexport default CheckoutProduct;\r\n","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Login\\Login.js",[],"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\firebaseConfig.js",[],"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Payment\\Payment.js",["90"],"import React, { useEffect, useState } from \"react\";\r\nimport \"./Payment.css\";\r\nimport { useDataLayerValue } from \"../../DataLayer\";\r\nimport CheckoutProduct from \"../CheckoutProduct/CheckoutProduct\";\r\nimport { Link, useHistory } from \"react-router-dom\";\r\nimport { CardElement, useStripe, useElements } from \"@stripe/react-stripe-js\";\r\nimport CurrencyFormat from \"react-currency-format\";\r\nimport { getBasketTotal } from \"../../reducer\";\r\nimport axios from '../../axios';\r\nimport {db} from '../../firebaseConfig'\r\n\r\n\r\nconst Payment = () => {\r\n const [{ basket, user }, dispatch] = useDataLayerValue();\r\n const history = useHistory();\r\n \r\n const stripe = useStripe();\r\n const elements = useElements();\r\n\r\n const [succeeded, setSucceeded] = useState(false);\r\n const [processing, setProcessing] = useState(\"\");\r\n const [error, setError] = useState(null);\r\n const [disabled, setDisabled] = useState(true);\r\n const [clientSecret, setClientSecret] = useState(true);\r\n\r\n useEffect(()=>{\r\n const getClientSecret = async () => {\r\n const response = await axios({\r\n method: 'post',\r\n // Stripe expects the total in a currencies subunit\r\n url: `/payments/create?total=${getBasketTotal(basket) * 100}`\r\n });\r\n setClientSecret(response.data.clientSecret)\r\n }\r\n getClientSecret();\r\n }, [basket])\r\n\r\n console.log(\"the secret key id >>>\",clientSecret);\r\n\r\n const handleSubmit = async (e) => {\r\n e.preventDefault();\r\n setProcessing(true);\r\n\r\n const payload = await stripe.confirmCardPayment(clientSecret,{\r\n payment_method: {\r\n card: elements.getElement(CardElement)\r\n }\r\n }).then(({paymentIntent})=>{\r\n // paymentIntent = payment confirmation\r\n\r\n db\r\n .collection('users')\r\n .doc(user?.uid)\r\n .collection('orders')\r\n .doc(paymentIntent.id)\r\n .set({\r\n basket: basket,\r\n amount: paymentIntent.amount,\r\n created: paymentIntent.created\r\n })\r\n\r\n setSucceeded(true)\r\n setError(null)\r\n setProcessing(false)\r\n\r\n dispatch({\r\n type: \"EMPTY_BASKET\"\r\n })\r\n\r\n history.replace('/orders')\r\n })\r\n };\r\n\r\n const handleChange = (e) => {\r\n setDisabled(e.empty);\r\n setError(e.error ? e.error.message : \"\");\r\n };\r\n\r\n return (\r\n <div className=\"payment\">\r\n <div className=\"payment__container\">\r\n <h1>\r\n Checkout (<Link to=\"/checkout\">{basket?.length} items</Link>)\r\n </h1>\r\n\r\n <div className=\"payment__section\">\r\n <div className=\"payment__title\">\r\n <h3>Delivery Address</h3>\r\n </div>\r\n <div className=\"payment__address\">\r\n <p>{user?.email}</p>\r\n <p>Gandaria,Dhaka</p>\r\n <p>Bangladesh</p>\r\n </div>\r\n </div>\r\n\r\n <div className=\"payment__section\">\r\n <div className=\"payment__title\">\r\n <h3>Review items and delivery</h3>\r\n </div>\r\n <div className=\"payment__items\">\r\n {basket.map((item) => (\r\n <CheckoutProduct\r\n id={item.id}\r\n image={item.image}\r\n rating={item.rating}\r\n price={item.price}\r\n title={item.title}\r\n />\r\n ))}\r\n </div>\r\n </div>\r\n\r\n <div className=\"payment__section\">\r\n <div className=\"payment__title\">\r\n <h3>Payment Method</h3>\r\n </div>\r\n <div className=\"payment__details\">\r\n \r\n <form onSubmit={handleSubmit}>\r\n <CardElement onChange={handleChange} />\r\n\r\n <div className=\"payment__priceContainer\">\r\n <CurrencyFormat\r\n renderText={(value) => (<h3>Order Total: {value}</h3>)}\r\n decimalScale={2}\r\n value={getBasketTotal(basket)}\r\n displayType={\"text\"}\r\n thousandSeparator={true}\r\n prefix={\"$\"}\r\n />\r\n <button disabled={processing || disabled || succeeded}>\r\n <span>{processing ? <p>Processing</p> : \"Buy Now\"}</span>\r\n </button>\r\n </div>\r\n {error && <div>{error}</div>}\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Payment;\r\n","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\axios.js",[],"C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Orders\\Orders.js",["91","92","93"],"import React, { useEffect, useState } from 'react';\r\nimport './Orders.css'\r\nimport { useDataLayerValue } from \"../../DataLayer\";\r\nimport {db} from '../../firebaseConfig'\r\nimport Order from '../Order/Order';\r\n\r\nconst Orders = () => {\r\n const [{ basket, user }, dispatch] = useDataLayerValue();\r\n const [orders, setOrders] = useState([]);\r\n\r\n useEffect(()=> {\r\n if(user) {\r\n db\r\n .collection('users')\r\n .doc(user?.uid)\r\n .collection('orders')\r\n .orderBy('created','desc')\r\n .onSnapshot(snapshot => (\r\n setOrders(snapshot.docs.map( doc=> ({\r\n id: doc.id,\r\n data: doc.data() \r\n })) )\r\n ))\r\n }\r\n else {\r\n setOrders([]);\r\n }\r\n })\r\n return (\r\n <div className='orders'>\r\n <h1>Your Orders</h1>\r\n <div className=\"orders__order\">\r\n {\r\n orders?.map(order => (\r\n <Order order={order} />\r\n ))\r\n }\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Orders;","C:\\Web Development\\React Project\\amazon-clone-fullstack\\amazon-clone\\src\\components\\Order\\Order.js",[],{"ruleId":"94","severity":1,"message":"95","line":4,"column":50,"nodeType":"96","messageId":"97","endLine":4,"endColumn":54},{"ruleId":"98","severity":1,"message":"99","line":19,"column":10,"nodeType":"100","messageId":"101","endLine":19,"endColumn":12},{"ruleId":"102","severity":1,"message":"103","line":38,"column":6,"nodeType":"104","endLine":38,"endColumn":8,"suggestions":"105"},{"ruleId":"94","severity":1,"message":"106","line":10,"column":27,"nodeType":"96","messageId":"97","endLine":10,"endColumn":35},{"ruleId":"107","replacedBy":"108"},{"ruleId":"109","replacedBy":"110"},{"ruleId":"107","replacedBy":"111"},{"ruleId":"109","replacedBy":"112"},{"ruleId":"94","severity":1,"message":"113","line":7,"column":11,"nodeType":"96","messageId":"97","endLine":7,"endColumn":17},{"ruleId":"94","severity":1,"message":"106","line":8,"column":28,"nodeType":"96","messageId":"97","endLine":8,"endColumn":36},{"ruleId":"94","severity":1,"message":"106","line":10,"column":21,"nodeType":"96","messageId":"97","endLine":10,"endColumn":29},{"ruleId":"94","severity":1,"message":"113","line":7,"column":12,"nodeType":"96","messageId":"97","endLine":7,"endColumn":18},{"ruleId":"94","severity":1,"message":"114","line":44,"column":13,"nodeType":"96","messageId":"97","endLine":44,"endColumn":20},{"ruleId":"94","severity":1,"message":"113","line":8,"column":14,"nodeType":"96","messageId":"97","endLine":8,"endColumn":20},{"ruleId":"94","severity":1,"message":"106","line":8,"column":30,"nodeType":"96","messageId":"97","endLine":8,"endColumn":38},{"ruleId":"102","severity":1,"message":"115","line":11,"column":5,"nodeType":"96","endLine":11,"endColumn":14,"suggestions":"116"},"no-unused-vars","'Link' is defined but never used.","Identifier","unusedVar","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",["117"],"'dispatch' is assigned a value but never used.","no-native-reassign",["118"],"no-negated-in-lhs",["119"],["118"],["119"],"'basket' is assigned a value but never used.","'payload' is assigned a value but never used.","React Hook useEffect contains a call to 'setOrders'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [user] as a second argument to the useEffect Hook.",["120"],{"desc":"121","fix":"122"},"no-global-assign","no-unsafe-negation",{"desc":"123","fix":"124"},"Update the dependencies array to be: [dispatch]",{"range":"125","text":"126"},"Add dependencies array: [user]",{"range":"127","text":"128"},[1178,1180],"[dispatch]",[825,825],", [user]"]