-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 10.8 KB
/
.eslintcache
1
[{"E:\\react\\contactbook\\src\\index.js":"1","E:\\react\\contactbook\\src\\App.js":"2","E:\\react\\contactbook\\src\\reportWebVitals.js":"3","E:\\react\\contactbook\\src\\Component\\Nav.jsx":"4","E:\\react\\contactbook\\src\\Component\\Contact.jsx":"5","E:\\react\\contactbook\\src\\Store.js":"6","E:\\react\\contactbook\\src\\Component\\AddContact.jsx":"7","E:\\react\\contactbook\\src\\Component\\EditContact.jsx":"8"},{"size":580,"mtime":1606972913227,"results":"9","hashOfConfig":"10"},{"size":865,"mtime":1606991730948,"results":"11","hashOfConfig":"10"},{"size":362,"mtime":499162500000,"results":"12","hashOfConfig":"10"},{"size":572,"mtime":1606988335309,"results":"13","hashOfConfig":"10"},{"size":2372,"mtime":1607140492161,"results":"14","hashOfConfig":"10"},{"size":1148,"mtime":1607140543508,"results":"15","hashOfConfig":"10"},{"size":1938,"mtime":1606989216214,"results":"16","hashOfConfig":"10"},{"size":2205,"mtime":1607140166700,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},"1a0dhzc",{"filePath":"21","messages":"22","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"23","usedDeprecatedRules":"20"},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},{"filePath":"29","messages":"30","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"31","usedDeprecatedRules":"20"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"34","usedDeprecatedRules":"20"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"39","usedDeprecatedRules":"20"},"E:\\react\\contactbook\\src\\index.js",[],["40","41"],"E:\\react\\contactbook\\src\\App.js",["42"],"import logo from \"./logo.svg\";\nimport \"./App.css\";\nimport Nav from \"./Component/Nav\";\nimport Contact from \"./Component/Contact\";\nimport { Provider } from \"react-redux\";\nimport store from \"./Store\";\nimport { BrowserRouter as Router, Switch, Route } from \"react-router-dom\";\nimport AddContact from \"./Component/AddContact\";\nimport EditContact from \"./Component/EditContact\";\nfunction App() {\n return (\n <Provider store={store}>\n <Router>\n <div className=\"App\">\n <Nav />\n <div className=\"container\">\n <Switch>\n <Route path=\"/\" exact component={Contact} />\n <Route path=\"/Add-contact\" component={AddContact} />\n <Route path=\"/Edit-contact/:id\" component={EditContact} />\n </Switch>\n </div>\n </div>\n </Router>\n </Provider>\n );\n}\n\nexport default App;\n","E:\\react\\contactbook\\src\\reportWebVitals.js",[],"E:\\react\\contactbook\\src\\Component\\Nav.jsx",[],["43","44"],"E:\\react\\contactbook\\src\\Component\\Contact.jsx",["45"],"import React, { useState } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { FiEdit } from \"react-icons/fi\";\r\nimport { MdDelete } from \"react-icons/md\";\r\nimport \"../index.css\";\r\nimport Avatar from \"react-avatar\";\r\nimport { Checkbox } from \"@material-ui/core\";\r\nimport { Link } from \"react-router-dom\";\r\nconst Contact = () => {\r\n const dispatch = useDispatch();\r\n const contact = useSelector((state) => state.contact);\r\n console.log(contact);\r\n const deletecontact = (id) => {\r\n dispatch({\r\n type: \"DELETE_CONTACT\",\r\n id,\r\n });\r\n };\r\n const UpdateContact = (id) => {\r\n dispatch({\r\n type: \"EDIT_CONTACT\",\r\n id: id,\r\n });\r\n };\r\n return (\r\n <div>\r\n <table className=\"table shadow \">\r\n <thead className=\"bg-danger text-white text-left \">\r\n <tr>\r\n <th>\r\n <Checkbox color=\"primary\" />\r\n </th>\r\n <th>Name</th>\r\n <th>Phone</th>\r\n <th>Email</th>\r\n <th>Action</th>\r\n </tr>\r\n </thead>\r\n {contact\r\n ? contact.map((info) => (\r\n <tbody className=\"text-left\" key={info.id}>\r\n <tr className=\"bg\">\r\n <td>\r\n <Checkbox />\r\n </td>\r\n\r\n <td>\r\n <Avatar name={info.data.name} size=\"40\" round={true} />\r\n {info.data.name}\r\n </td>\r\n <td>{info.data.phone}</td>\r\n <td>{info.data.email}</td>\r\n <td className=\"visible\">\r\n <Link to={`/Edit-Contact/${info.id}`}>\r\n <FiEdit\r\n fontSize=\"x-large\"\r\n className=\"mr-2\"\r\n style={{ color: \"#6e4aa5\", cursor: \"pointer\" }}\r\n onClick={() => UpdateContact(info.id)}\r\n />\r\n </Link>\r\n\r\n <MdDelete\r\n fontSize=\"x-large\"\r\n style={{ color: \"#6e4aa5\", cursor: \"pointer\" }}\r\n onClick={() => deletecontact(info.id)}\r\n />\r\n </td>\r\n </tr>\r\n </tbody>\r\n ))\r\n : \"\"}\r\n </table>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Contact;\r\n","E:\\react\\contactbook\\src\\Store.js",["46","47"],"const { createStore } = require(\"redux\");\r\nconst { composeWithDevTools } = require(\"redux-devtools-extension\");\r\n\r\nconst initailState = {\r\n contact: [],\r\n selected: {},\r\n};\r\nconst contactReducer = (state = initailState, action) => {\r\n console.log(action);\r\n switch (action.type) {\r\n case \"CONTACT_DETAILS\":\r\n return {\r\n ...state,\r\n contact: [...state.contact, action],\r\n };\r\n case \"EDIT_CONTACT\":\r\n let arr = state.contact.filter((contact) => contact.id == action.id);\r\n arr = arr.values();\r\n console.log(arr);\r\n for (let val of arr) {\r\n arr = val;\r\n }\r\n return {\r\n ...state,\r\n selected: arr,\r\n };\r\n case \"UPDATE_CONTACT\":\r\n return {\r\n ...state,\r\n contact: state.contact.map((data) =>\r\n data.id == action.id ? action : data\r\n ),\r\n };\r\n case \"DELETE_CONTACT\":\r\n return {\r\n ...state,\r\n contact: state.contact.filter((data) => data.id !== action.id),\r\n };\r\n default:\r\n return state;\r\n }\r\n};\r\nconst store = createStore(contactReducer, composeWithDevTools());\r\nexport default store;\r\n","E:\\react\\contactbook\\src\\Component\\AddContact.jsx",[],"E:\\react\\contactbook\\src\\Component\\EditContact.jsx",["48","49"],"import React, { useState } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { useParams } from \"react-router-dom\";\r\nimport shortid from \"shortid\";\r\nimport Contact from \"./Contact\";\r\n\r\nconst EditContact = () => {\r\n const selected = useSelector((state) => state.selected);\r\n console.log(selected);\r\n\r\n const [data, setdata] = useState({\r\n name: selected.data.name,\r\n phone: selected.data.phone,\r\n email: selected.data.email,\r\n });\r\n const { id } = useParams();\r\n console.log(id);\r\n const dispatch = useDispatch();\r\n const handelinput = (e) => {\r\n let { name, value } = e.target;\r\n setdata((prev) => {\r\n return {\r\n ...prev,\r\n [name]: value,\r\n };\r\n });\r\n };\r\n const handelsubmit = (e) => {\r\n e.preventDefault();\r\n dispatch({\r\n type: \"UPDATE_CONTACT\",\r\n data,\r\n id,\r\n });\r\n setdata({ name: \"\", phone: \"\", email: \"\" });\r\n };\r\n return (\r\n <div className=\"card shadow\">\r\n <div className=\"card-header\">\r\n Update Contact\r\n <form className=\"card-body\" onSubmit={handelsubmit}>\r\n <div className=\"form-group\">\r\n <input\r\n type=\"text\"\r\n name=\"name\"\r\n onChange={handelinput}\r\n value={data.name}\r\n className=\"form-control\"\r\n placeholder=\"Enter The Name\"\r\n />\r\n </div>\r\n <div className=\"form-group\">\r\n <input\r\n type=\"num\"\r\n name=\"phone\"\r\n onChange={handelinput}\r\n value={data.phone}\r\n className=\"form-control\"\r\n placeholder=\"Enter The Phone No\"\r\n />\r\n </div>\r\n <div className=\"form-group\">\r\n <input\r\n type=\"email\"\r\n name=\"email\"\r\n onChange={handelinput}\r\n value={data.email}\r\n className=\"form-control\"\r\n placeholder=\"Enter The Email\"\r\n />\r\n </div>\r\n <button className=\"btn btn-primary\" type=\"submit\">\r\n Update\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default EditContact;\r\n",{"ruleId":"50","replacedBy":"51"},{"ruleId":"52","replacedBy":"53"},{"ruleId":"54","severity":1,"message":"55","line":1,"column":8,"nodeType":"56","messageId":"57","endLine":1,"endColumn":12},{"ruleId":"50","replacedBy":"58"},{"ruleId":"52","replacedBy":"59"},{"ruleId":"54","severity":1,"message":"60","line":1,"column":17,"nodeType":"56","messageId":"57","endLine":1,"endColumn":25},{"ruleId":"61","severity":1,"message":"62","line":17,"column":62,"nodeType":"63","messageId":"64","endLine":17,"endColumn":64},{"ruleId":"61","severity":1,"message":"62","line":31,"column":19,"nodeType":"63","messageId":"64","endLine":31,"endColumn":21},{"ruleId":"54","severity":1,"message":"65","line":4,"column":8,"nodeType":"56","messageId":"57","endLine":4,"endColumn":15},{"ruleId":"54","severity":1,"message":"66","line":5,"column":8,"nodeType":"56","messageId":"57","endLine":5,"endColumn":15},"no-native-reassign",["67"],"no-negated-in-lhs",["68"],"no-unused-vars","'logo' is defined but never used.","Identifier","unusedVar",["67"],["68"],"'useState' is defined but never used.","eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","'shortid' is defined but never used.","'Contact' is defined but never used.","no-global-assign","no-unsafe-negation"]