-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 20.1 KB
/
.eslintcache
1
[{"D:\\Aayush\\Projects\\amazon-clone\\src\\index.js":"1","D:\\Aayush\\Projects\\amazon-clone\\src\\App.js":"2","D:\\Aayush\\Projects\\amazon-clone\\src\\reportWebVitals.js":"3","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Header.js":"4","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Checkout.js":"5","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Home.js":"6","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Subtotal.js":"7","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Product.js":"8","D:\\Aayush\\Projects\\amazon-clone\\src\\reducer.js":"9","D:\\Aayush\\Projects\\amazon-clone\\src\\StateProvider.js":"10","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\CheckoutProduct.js":"11","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Login.js":"12","D:\\Aayush\\Projects\\amazon-clone\\src\\firebase.js":"13","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Payment.js":"14","D:\\Aayush\\Projects\\amazon-clone\\src\\axios.js":"15","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Orders.js":"16","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Order.js":"17"},{"size":689,"mtime":1610558719640,"results":"18","hashOfConfig":"19"},{"size":1790,"mtime":1610976325581,"results":"20","hashOfConfig":"19"},{"size":362,"mtime":499162500000,"results":"21","hashOfConfig":"19"},{"size":1960,"mtime":1610976434894,"results":"22","hashOfConfig":"19"},{"size":1092,"mtime":1610739826863,"results":"23","hashOfConfig":"19"},{"size":2553,"mtime":1610557943093,"results":"24","hashOfConfig":"19"},{"size":1064,"mtime":1610823691495,"results":"25","hashOfConfig":"19"},{"size":1991,"mtime":1612116946962,"results":"26","hashOfConfig":"19"},{"size":1048,"mtime":1610911234063,"results":"27","hashOfConfig":"19"},{"size":365,"mtime":1610558213891,"results":"28","hashOfConfig":"19"},{"size":1066,"mtime":1610976058523,"results":"29","hashOfConfig":"19"},{"size":1962,"mtime":1612116176615,"results":"30","hashOfConfig":"19"},{"size":532,"mtime":1610737014183,"results":"31","hashOfConfig":"19"},{"size":4207,"mtime":1610913477068,"results":"32","hashOfConfig":"19"},{"size":337,"mtime":1610978596906,"results":"33","hashOfConfig":"19"},{"size":996,"mtime":1610914621711,"results":"34","hashOfConfig":"19"},{"size":1016,"mtime":1610976073322,"results":"35","hashOfConfig":"19"},{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},"ymbzdi",{"filePath":"39","messages":"40","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"41","usedDeprecatedRules":"38"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},{"filePath":"44","messages":"45","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"46","usedDeprecatedRules":"38"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"49","usedDeprecatedRules":"38"},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},{"filePath":"52","messages":"53","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"54","usedDeprecatedRules":"38"},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},{"filePath":"61","messages":"62","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"63","usedDeprecatedRules":"38"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},{"filePath":"68","messages":"69","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"70","usedDeprecatedRules":"38"},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"75","usedDeprecatedRules":"38"},{"filePath":"76","messages":"77","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},"D:\\Aayush\\Projects\\amazon-clone\\src\\index.js",[],["78","79"],"D:\\Aayush\\Projects\\amazon-clone\\src\\App.js",["80","81"],"import React, { useEffect } from 'react';\nimport './App.css';\nimport Header from './components/Header';\nimport Home from './components/Home';\nimport Checkout from './components/Checkout';\nimport Login from './components/Login';\nimport Payment from './components/Payment';\nimport Orders from './components/Orders';\nimport { BrowserRouter as Router, Switch, Route } from 'react-router-dom';\nimport { auth } from './firebase';\nimport { useStateValue } from './StateProvider';\nimport { loadStripe } from '@stripe/stripe-js';\nimport { Elements } from '@stripe/react-stripe-js';\n\nconst promise = loadStripe(\n 'pk_test_51IAKgrJz5HFCndJJkgpVGxWosBC57Nek1DmOJpU1NokRSl85YmwHqsJGudHeZpbklzj6AJclRx7oJmlsFpxtKF6b00fEDpqMJS'\n);\n\nfunction App() {\n const [{}, dispatch] = useStateValue();\n\n useEffect(() => {\n auth.onAuthStateChanged((authUser) => {\n console.log('The user is >>', authUser);\n if (authUser) {\n dispatch({\n type: 'SET_USER',\n user: authUser,\n });\n } else {\n dispatch({\n type: 'SET_USER',\n user: null,\n });\n }\n });\n }, []);\n\n return (\n <Router>\n <div className='App'>\n <Switch>\n <Route path='/login'>\n <Login />\n </Route>\n <Route path='/orders'>\n <Header />\n <Orders />\n </Route>\n <Route path='/checkout'>\n <Header />\n <Checkout />\n </Route>\n <Route path='/payment'>\n <Header />\n <Elements stripe={promise}>\n <Payment />\n </Elements>\n </Route>\n <Route path='/'>\n <Header />\n <Home />\n </Route>\n </Switch>\n </div>\n </Router>\n );\n}\n\nexport default App;\n","D:\\Aayush\\Projects\\amazon-clone\\src\\reportWebVitals.js",[],"D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Header.js",["82"],"import React from 'react';\r\nimport './Header.css';\r\nimport SearchIcon from '@material-ui/icons/Search';\r\nimport ShoppingBasketIcon from '@material-ui/icons/ShoppingBasket';\r\nimport { Link } from 'react-router-dom';\r\nimport { useStateValue } from '../StateProvider';\r\nimport { auth } from '../firebase';\r\n\r\nfunction Header() {\r\n const [{ basket, user }, dispatch] = useStateValue();\r\n\r\n const handleAuthentication = () => {\r\n if (user) {\r\n auth.signOut();\r\n }\r\n };\r\n return (\r\n <div className='header'>\r\n <Link to='/'>\r\n <img className='header__logo' src='http://pngimg.com/uploads/amazon/amazon_PNG11.png' alt='AmazonLogo' />\r\n </Link>\r\n <div className='header__search'>\r\n <input className='header__searchInput' type='text' />\r\n <SearchIcon className='header__searchIcon' />\r\n </div>\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='/orders'>\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 <ShoppingBasketIcon />\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","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Checkout.js",["83"],"import React from 'react';\r\nimport { useStateValue } from '../StateProvider';\r\nimport './Checkout.css';\r\nimport CheckoutProduct from './CheckoutProduct';\r\nimport Subtotal from './Subtotal';\r\n\r\nfunction Checkout() {\r\n const [{ basket, user }, dispatch] = useStateValue();\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='Ad'\r\n />\r\n <div>\r\n <h3>Hello, {user?.email}</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 title={item.title}\r\n image={item.image}\r\n price={item.price}\r\n rating={item.rating}\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","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Home.js",[],"D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Subtotal.js",["84"],"import React from 'react';\r\nimport './Subtotal.css';\r\nimport CurrencyFormat from 'react-currency-format';\r\nimport { useStateValue } from '../StateProvider';\r\nimport { getBasketTotal } from '../reducer';\r\n\r\nfunction Subtotal() {\r\n const [{ basket }, dispatch] = useStateValue();\r\n\r\n return (\r\n <div className='subtotal'>\r\n <CurrencyFormat\r\n renderText={(value) => (\r\n <>\r\n <p>\r\n Subtotal ({basket.length} items):\r\n <strong>{value}</strong>\r\n </p>\r\n <small className='subtotal__gift'>\r\n <input type='checkbox' /> This order contains a gift\r\n </small>\r\n </>\r\n )}\r\n decimalScale={2}\r\n value={getBasketTotal(basket)}\r\n displayType={'text'}\r\n thousandSeperator={true}\r\n prefix={'$'}\r\n />\r\n <button>Proceed to Checkout</button>\r\n </div>\r\n );\r\n}\r\n\r\nexport default Subtotal;\r\n","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Product.js",[],"D:\\Aayush\\Projects\\amazon-clone\\src\\reducer.js",[],"D:\\Aayush\\Projects\\amazon-clone\\src\\StateProvider.js",[],"D:\\Aayush\\Projects\\amazon-clone\\src\\components\\CheckoutProduct.js",["85"],"import React from 'react';\r\nimport { useStateValue } from '../StateProvider';\r\nimport './CheckoutProduct.css';\r\n\r\nfunction CheckoutProduct({ id, image, title, price, rating, hideButton }) {\r\n const [{ basket }, dispatch] = useStateValue();\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\r\n return (\r\n <div className='checkoutProduct'>\r\n <img className='checkoutProduct__image' src={image} alt={title} />\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='checkoutProduct__rating'>\r\n {Array(rating)\r\n .fill()\r\n .map((_, i) => (\r\n <p>⭐</p>\r\n ))}\r\n </div>\r\n {!hideButton && <button onClick={removeFromBasket}>Remove from Basket</button>}\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default CheckoutProduct;\r\n","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Login.js",[],"D:\\Aayush\\Projects\\amazon-clone\\src\\firebase.js",[],"D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Payment.js",["86"],"import { CardElement, useElements, useStripe } from '@stripe/react-stripe-js';\r\nimport React, { useEffect, useState } from 'react';\r\nimport CurrencyFormat from 'react-currency-format';\r\nimport { Link, useHistory } from 'react-router-dom';\r\nimport { getBasketTotal } from '../reducer';\r\nimport { useStateValue } from '../StateProvider';\r\nimport CheckoutProduct from './CheckoutProduct';\r\nimport './Payment.css';\r\nimport axios from '../axios';\r\nimport { db } from '../firebase';\r\n\r\nfunction Payment() {\r\n const [{ basket, user }, dispatch] = useStateValue();\r\n const [error, setError] = useState(null);\r\n const [disabled, setDisabled] = useState(true);\r\n const [processing, setProcessing] = useState(false);\r\n const [succeeded, setSucceeded] = useState('');\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 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 const history = useHistory();\r\n const stripe = useStripe();\r\n const elements = useElements();\r\n\r\n console.log('The Secret is >>', clientSecret);\r\n\r\n const handleSubmit = async (event) => {\r\n event.preventDefault();\r\n setProcessing(true);\r\n const payload = await stripe\r\n .confirmCardPayment(clientSecret, {\r\n payment_method: {\r\n card: elements.getElement(CardElement),\r\n },\r\n })\r\n .then(({ paymentIntent }) => {\r\n db.collection('users').doc(user?.uid).collection('orders').doc(paymentIntent.id).set({\r\n basket: basket,\r\n amount: paymentIntent.amount,\r\n created: paymentIntent.created,\r\n });\r\n setSucceeded(true);\r\n setError(null);\r\n setProcessing(false);\r\n dispatch({\r\n type: 'EMPTY_BASKET',\r\n });\r\n history.replace('/orders');\r\n });\r\n };\r\n\r\n const handleChange = (event) => {\r\n setDisabled(event.empty);\r\n setError(event.error ? event.error.message : '');\r\n };\r\n\r\n return (\r\n <div className='payment'>\r\n <div className='payment__container'>\r\n <h1>Checkout {<Link to='checkout'>({basket?.length} items)</Link>}</h1>\r\n <div className='payment__section'>\r\n <div className='payment__title'>\r\n <h3>Dilivery Address</h3>\r\n </div>\r\n <div className='payment__address'>\r\n <p>{user?.email}</p>\r\n <p>Sector 11</p>\r\n <p>Panchkula, Haryana, IN</p>\r\n </div>\r\n </div>\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 title={item.title}\r\n image={item.image}\r\n price={item.price}\r\n rating={item.rating}\r\n />\r\n ))}\r\n </div>\r\n </div>\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 <form onSubmit={handleSubmit}>\r\n <CardElement onChange={handleChange} />\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 thousandSeperator={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","D:\\Aayush\\Projects\\amazon-clone\\src\\axios.js",[],"D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Orders.js",["87","88"],"import React, { useEffect, useState } from 'react';\r\nimport { db } from '../firebase';\r\nimport { useStateValue } from '../StateProvider';\r\nimport './Orders.css';\r\nimport Order from './Order';\r\n\r\nfunction Orders() {\r\n const [orders, setOrders] = useState();\r\n const [{ basket, user }, dispatch] = useStateValue();\r\n\r\n useEffect(() => {\r\n if (user) {\r\n db.collection('users')\r\n .doc(user?.uid)\r\n .collection('orders')\r\n .orderBy('created', 'desc')\r\n .onSnapshot((snapshot) => {\r\n setOrders(\r\n 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 }, [user]);\r\n return (\r\n <div className='orders'>\r\n <h1>Your Orders</h1>\r\n <div className='orders__order'>\r\n {orders?.map((order) => (\r\n <Order order={order} />\r\n ))}\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default Orders;\r\n","D:\\Aayush\\Projects\\amazon-clone\\src\\components\\Order.js",[],{"ruleId":"89","replacedBy":"90"},{"ruleId":"91","replacedBy":"92"},{"ruleId":"93","severity":1,"message":"94","line":20,"column":10,"nodeType":"95","messageId":"96","endLine":20,"endColumn":12},{"ruleId":"97","severity":1,"message":"98","line":37,"column":6,"nodeType":"99","endLine":37,"endColumn":8,"suggestions":"100"},{"ruleId":"101","severity":1,"message":"102","line":10,"column":28,"nodeType":"103","messageId":"104","endLine":10,"endColumn":36},{"ruleId":"101","severity":1,"message":"102","line":8,"column":28,"nodeType":"103","messageId":"104","endLine":8,"endColumn":36},{"ruleId":"101","severity":1,"message":"102","line":8,"column":22,"nodeType":"103","messageId":"104","endLine":8,"endColumn":30},{"ruleId":"101","severity":1,"message":"105","line":6,"column":12,"nodeType":"103","messageId":"104","endLine":6,"endColumn":18},{"ruleId":"101","severity":1,"message":"106","line":40,"column":11,"nodeType":"103","messageId":"104","endLine":40,"endColumn":18},{"ruleId":"101","severity":1,"message":"105","line":9,"column":12,"nodeType":"103","messageId":"104","endLine":9,"endColumn":18},{"ruleId":"101","severity":1,"message":"102","line":9,"column":28,"nodeType":"103","messageId":"104","endLine":9,"endColumn":36},"no-native-reassign",["107"],"no-negated-in-lhs",["108"],"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",["109"],"no-unused-vars","'dispatch' is assigned a value but never used.","Identifier","unusedVar","'basket' is assigned a value but never used.","'payload' is assigned a value but never used.","no-global-assign","no-unsafe-negation",{"desc":"110","fix":"111"},"Update the dependencies array to be: [dispatch]",{"range":"112","text":"113"},[1113,1115],"[dispatch]"]