-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 17.6 KB
/
.eslintcache
1
[{"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/reportWebVitals.js":"1","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/App.js":"2","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/index.js":"3","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Header.js":"4","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Home.js":"5","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Product.js":"6","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Checkout.js":"7","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Subtotal.js":"8","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/reducer.js":"9","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/StateProvider.js":"10","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/CheckoutProduct.js":"11","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Login.js":"12","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/firebase.js":"13","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Payment.js":"14","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/axios.js":"15","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Orders.js":"16","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Order.js":"17"},{"size":362,"mtime":1606375454946,"results":"18","hashOfConfig":"19"},{"size":2126,"mtime":1609744454440,"results":"20","hashOfConfig":"19"},{"size":807,"mtime":1607412408782,"results":"21","hashOfConfig":"19"},{"size":2276,"mtime":1609660119028,"results":"22","hashOfConfig":"19"},{"size":2520,"mtime":1606981170070,"results":"23","hashOfConfig":"19"},{"size":1057,"mtime":1608534904198,"results":"24","hashOfConfig":"19"},{"size":1071,"mtime":1608534667858,"results":"25","hashOfConfig":"19"},{"size":1173,"mtime":1608621859608,"results":"26","hashOfConfig":"19"},{"size":1768,"mtime":1609484718850,"results":"27","hashOfConfig":"19"},{"size":509,"mtime":1607411728703,"results":"28","hashOfConfig":"19"},{"size":1131,"mtime":1609659945375,"results":"29","hashOfConfig":"19"},{"size":2574,"mtime":1608277625448,"results":"30","hashOfConfig":"19"},{"size":665,"mtime":1608275728695,"results":"31","hashOfConfig":"19"},{"size":5584,"mtime":1609744393137,"results":"32","hashOfConfig":"19"},{"size":189,"mtime":1609228415109,"results":"33","hashOfConfig":"19"},{"size":180,"mtime":1609485072794,"results":"34","hashOfConfig":"19"},{"size":950,"mtime":1609659967379,"results":"35","hashOfConfig":"19"},{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},"1d1x9lu",{"filePath":"39","messages":"40","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"43"},{"filePath":"44","messages":"45","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"50","usedDeprecatedRules":"51"},{"filePath":"52","messages":"53","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"54","usedDeprecatedRules":"55"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"58","usedDeprecatedRules":"55"},{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"63"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},{"filePath":"68","messages":"69","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"43"},{"filePath":"70","messages":"71","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"72"},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"75","messages":"76","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/reportWebVitals.js",[],["79","80"],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/App.js",["81","82"],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/index.js",[],["83","84"],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Header.js",["85"],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Home.js",[],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Product.js",["86"],"import React from \"react\";\nimport \"./Product.css\";\nimport { useStateValue } from \"./StateProvider\";\n\nfunction Product({ id, title, image, price, rating }) {\n const [{ basket }, dispatch] = useStateValue();\n // console.log(\"this is the basket >>>\", basket);\n const addToBasket = () => {\n // dispatch action (item) into dataLayer\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 return (\n <div className=\"product\">\n <div className=\"product__info\">\n <p>{title}</p>\n <p className=\"product__price\">\n <small>$</small>\n <strong>{price}</strong>\n </p>\n <div className=\"product__rating\">\n {Array(rating)\n .fill()\n .map((_, i) => (\n <p>⭐️</p>\n ))}\n </div>\n </div>\n <img src={image} alt=\"\" />\n <button onClick={addToBasket}>Add to Basket</button>\n </div>\n );\n}\n\nexport default Product;\n",["87","88"],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Checkout.js",["89"],"import React from \"react\";\nimport \"./Checkout.css\";\nimport Subtotal from \"./Subtotal\";\nimport { useStateValue } from \"./StateProvider\";\nimport CheckoutProduct from \"./CheckoutProduct\";\n\nfunction Checkout() {\n const [{ basket, user }, dispatch] = useStateValue();\n return (\n <div className=\"checkout\">\n <div className=\"checkout__left\">\n <img\n className=\"checkout__ad\"\n src=\"https://images-na.ssl-images-amazon.\n com/images/G/02/UK_CCMP/TM/OCC_Amazon1.\n _CB423492668_.jpg\"\n alt=\"\"\n />\n <div>\n <h3>Hello, {user?.email}</h3>\n <h2 className=\"checkout__title\">Your shopping basket</h2>\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 <div className=\"checkout__right\">\n <Subtotal />\n </div>\n </div>\n );\n}\n\nexport default Checkout;\n",["90","91"],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Subtotal.js",["92"],"import React from \"react\";\nimport \"./Subtotal.css\";\nimport CurrencyFormat from \"react-currency-format\";\nimport { useStateValue } from \"./StateProvider\";\nimport { getBasketTotal } from \"./reducer\";\nimport { useHistory } from \"react-router-dom\";\n\nfunction Subtotal() {\n // import history from react-router-dom to get browser history\n const history = useHistory();\n const [{ basket }, dispatch] = useStateValue();\n return (\n <div className=\"subtotal\">\n <CurrencyFormat\n renderText={value => (\n <>\n <p>\n Subtotal ({basket.length} items): <strong>{value}</strong>\n </p>\n <small className=\"subtotal_gift\">\n <input type=\"checkbox\" /> This order contains a gift\n </small>\n </>\n )}\n //\n decimalScale={2}\n value={getBasketTotal(basket)}\n displayType={\"text\"}\n thousandSeparator={true}\n prefix={\"$\"}\n />\n {/* using history like link to push payment page into browser */}\n <button onClick={event => history.push(\"/payment\")}>\n Proceed to Checkout\n </button>\n </div>\n );\n}\n\nexport default Subtotal;\n","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/reducer.js",[],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/StateProvider.js",[],["93","94"],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/CheckoutProduct.js",["95"],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Login.js",[],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/firebase.js",[],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Payment.js",["96"],"import React, { useState, useEffect } from \"react\";\nimport \"./Payment.css\";\nimport { useStateValue } from \"./StateProvider\";\nimport CheckoutProduct from \"./CheckoutProduct\";\nimport { Link, useHistory } from \"react-router-dom\";\nimport { CardElement, useElements, useStripe } from \"@stripe/react-stripe-js\";\nimport CurrencyFormat from \"react-currency-format\";\nimport { getBasketTotal } from \"./reducer\";\nimport axios from \"./axios\";\nimport { db } from \"./firebase\";\n\nfunction Payment() {\n const [{ basket, user }, dispatch] = useStateValue();\n const history = useHistory();\n\n // use these hooks below\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 // generate secret for stripe that allows us to charge a customer\n const getClientSecret = async () => {\n const response = await axios({\n method: \"post\",\n // stripe expects total in currencies subunits so ex: multiple by 100 to get .00\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 // some fancy stripe stuff here\n // stop refreshing\n event.preventDefault();\n // only can click buy once and then it stops\n setProcessing(true);\n\n // you need to tell stripe (or any processing software you're using)\n // a client secret to let you know you want to send money\n const payload = await stripe\n .confirmCardPayment(clientSecret, {\n payment_method: {\n card: elements.getElement(CardElement)\n }\n })\n .then(({ paymentIntent }) => {\n // paymentIntent = payment confirmation\n\n // when the order comes back successful, reach into the db of users\n db.collection(\"users\")\n // to that specific user\n .doc(user?.uid)\n // to their orders\n .collection(\"orders\")\n // create a document with a paymentIntent.id\n .doc(paymentIntent.id)\n // add this info below to it\n .set({\n basket: basket,\n amount: paymentIntent.amount,\n create: paymentIntent.created\n });\n\n setSucceeded(true);\n setError(null);\n setProcessing(false);\n\n // this dispatch is to empty the basket after order is placed, the type lives in reducer.js\n dispatch({\n type: \"EMPTY_BASKET\"\n });\n\n history.replace(\"/orders\");\n });\n };\n\n const handleChange = event => {\n // listen for any changes in CardElement and display any errors as the customer types in their card details\n // if the event is empty, then disable the button\n setDisabled(event.empty);\n // if there is an error, show the error message, otherwise show nothing\n setError(event.error ? event.error.message : \"\");\n };\n\n return (\n <div className=\"payment\">\n <div className=\"payment__container\">\n <h1>\n Checkout (<Link to=\"/checkout\">{basket.length}items</Link>)\n </h1>\n\n {/* payment section - delivery address */}\n <div className=\"payment__section\">\n <div className=\"payment__title\">\n <h3>Delivery Address</h3>\n </div>\n <div className=\"payment__address\">\n <p>{user?.email}</p>\n <p>123 react lane</p>\n <p>Orange,CA</p>\n </div>\n </div>\n {/* payment section - review items */}\n <div className=\"payment__section\">\n <div className=\"payment__title\">\n <h3>Review items and delivery</h3>\n </div>\n\n <div className=\"payment__items\">\n {/* products in basket will show here */}\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 {/* payment section - payment method */}\n <div className=\"payment__section\">\n <div className=\"payment__title\">\n <h3>Payment Method</h3>\n </div>\n <div className=\"payment__details\">\n {/* stripe magic goes here */}\n <form onSubmit={handleSubmit}>\n {/* CardElement comes from stripe, handle the change is a function I created for when the card changes */}\n <CardElement onChange={handleChange} />\n <div className=\"payment__priceContainer\">\n <CurrencyFormat\n renderText={value => <h3>Order Total: {value}</h3>}\n decimalScale={2}\n value={getBasketTotal(basket)}\n displayType={\"text\"}\n thousandsSeparator={true}\n prefix={\"$\"}\n />\n <button disabled={processing || disabled || succeeded}>\n <span>{processing ? <p>Processing...</p> : \"Buy Now\"}</span>\n </button>\n </div>\n {/* errors */}\n {error && <div>{error}</div>}\n </form>\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nexport default Payment;\n","/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/axios.js",[],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Orders.js",[],"/Users/brandonh91/Documents/Design-Development/Development/eCommerce/src/Order.js",[],{"ruleId":"97","replacedBy":"98"},{"ruleId":"99","replacedBy":"100"},{"ruleId":"101","severity":1,"message":"102","line":22,"column":10,"nodeType":"103","messageId":"104","endLine":22,"endColumn":12},{"ruleId":"105","severity":1,"message":"106","line":44,"column":6,"nodeType":"107","endLine":44,"endColumn":8,"suggestions":"108"},{"ruleId":"97","replacedBy":"109"},{"ruleId":"99","replacedBy":"110"},{"ruleId":"111","severity":1,"message":"112","line":10,"column":28,"nodeType":"113","messageId":"114","endLine":10,"endColumn":36},{"ruleId":"111","severity":1,"message":"115","line":6,"column":12,"nodeType":"113","messageId":"114","endLine":6,"endColumn":18},{"ruleId":"97","replacedBy":"116"},{"ruleId":"99","replacedBy":"117"},{"ruleId":"111","severity":1,"message":"112","line":8,"column":28,"nodeType":"113","messageId":"114","endLine":8,"endColumn":36},{"ruleId":"97","replacedBy":"118"},{"ruleId":"99","replacedBy":"119"},{"ruleId":"111","severity":1,"message":"112","line":11,"column":22,"nodeType":"113","messageId":"114","endLine":11,"endColumn":30},{"ruleId":"97","replacedBy":"120"},{"ruleId":"99","replacedBy":"121"},{"ruleId":"111","severity":1,"message":"115","line":6,"column":12,"nodeType":"113","messageId":"114","endLine":6,"endColumn":18},{"ruleId":"111","severity":1,"message":"122","line":50,"column":11,"nodeType":"113","messageId":"114","endLine":50,"endColumn":18},"no-native-reassign",["123"],"no-negated-in-lhs",["124"],"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",["125"],["123"],["124"],"no-unused-vars","'dispatch' is assigned a value but never used.","Identifier","unusedVar","'basket' is assigned a value but never used.",["123"],["124"],["123"],["124"],["123"],["124"],"'payload' is assigned a value but never used.","no-global-assign","no-unsafe-negation",{"desc":"126","fix":"127"},"Update the dependencies array to be: [dispatch]",{"range":"128","text":"129"},[1386,1388],"[dispatch]"]