-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 4.72 KB
/
.eslintcache
1
[{"/home/sourik/codes/node/Chat Lush v2/src/index.js":"1","/home/sourik/codes/node/Chat Lush v2/src/App.js":"2","/home/sourik/codes/node/Chat Lush v2/src/serviceWorker.js":"3"},{"size":503,"mtime":1600882773000,"results":"4","hashOfConfig":"5"},{"size":2933,"mtime":1608046907860,"results":"6","hashOfConfig":"5"},{"size":5086,"mtime":1600882773000,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"10"},"1iae0qn",{"filePath":"11","messages":"12","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"13","usedDeprecatedRules":"10"},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"16"},"/home/sourik/codes/node/Chat Lush v2/src/index.js",[],["17","18"],"/home/sourik/codes/node/Chat Lush v2/src/App.js",["19","20"],"import React, { useRef, useState } from 'react';\nimport './App.css';\n\nimport firebase from 'firebase/app';\nimport 'firebase/firestore';\nimport 'firebase/auth';\nimport 'firebase/analytics';\n\nimport { useAuthState } from 'react-firebase-hooks/auth';\nimport { useCollectionData } from 'react-firebase-hooks/firestore';\n\nfirebase.initializeApp({\n apiKey: \"AIzaSyDzv3vr1Fq6HUbbHADd1JfqK14Rvdyfs0g\",\n authDomain: \"chat-lush-v2.firebaseapp.com\",\n projectId: \"chat-lush-v2\",\n storageBucket: \"chat-lush-v2.appspot.com\",\n messagingSenderId: \"262628244753\",\n appId: \"1:262628244753:web:d1c58f0067343c02a420b0\",\n measurementId: \"G-LJH9XW5RHY\"\n})\n\nconst auth = firebase.auth();\nconst firestore = firebase.firestore();\nconst analytics = firebase.analytics();\n\n\nfunction App() {\n\n const [user] = useAuthState(auth);\n\n return (\n <div className=\"App\">\n <header>\n <h1>Chat Lush v2🔥</h1>\n <SignOut />\n </header>\n\n <section>\n {user ? <ChatRoom /> : <SignIn />}\n </section>\n\n </div>\n );\n}\n\nfunction SignIn() {\n\n const signInWithGoogle = () => {\n const provider = new firebase.auth.GoogleAuthProvider();\n auth.signInWithPopup(provider);\n }\n\n return (\n <>\n <button className=\"sign-in\" onClick={signInWithGoogle}>Sign in with Google</button>\n <p>Do not violate the community guidelines or you will be banned for life!</p>\n </>\n )\n\n}\n\nfunction SignOut() {\n return auth.currentUser && (\n <button className=\"sign-out\" onClick={() => auth.signOut()}>Sign Out</button>\n )\n}\n\n\nfunction ChatRoom() {\n const dummy = useRef();\n const messagesRef = firestore.collection('messages');\n const query = messagesRef.orderBy('createdAt').limit(25);\n\n const [messages] = useCollectionData(query, { idField: 'id' });\n\n const [formValue, setFormValue] = useState('');\n\n\n const sendMessage = async (e) => {\n e.preventDefault();\n\n const { uid, photoURL } = auth.currentUser;\n\n await messagesRef.add({\n text: formValue,\n createdAt: firebase.firestore.FieldValue.serverTimestamp(),\n uid,\n photoURL\n })\n\n setFormValue('');\n dummy.current.scrollIntoView({ behavior: 'smooth' });\n }\n\n return (<>\n <main>\n\n {messages && messages.map(msg => <ChatMessage key={msg.id} message={msg} />)}\n\n <span ref={dummy}></span>\n\n </main>\n\n <form onSubmit={sendMessage}>\n\n <input value={formValue} onChange={(e) => setFormValue(e.target.value)} placeholder=\"say something nice\" />\n\n <button type=\"submit\" disabled={!formValue}>🕊️</button>\n\n </form>\n </>)\n}\n\n\nfunction ChatMessage(props) {\n const { text, uid, photoURL } = props.message;\n\n const messageClass = uid === auth.currentUser.uid ? 'sent' : 'received';\n\n return (<>\n <div className={`message ${messageClass}`}>\n <img src={photoURL || 'https://api.adorable.io/avatars/23/[email protected]'} />\n <p>{text}</p>\n </div>\n </>)\n}\n\n\nexport default App;\n","/home/sourik/codes/node/Chat Lush v2/src/serviceWorker.js",[],["21","22"],{"ruleId":"23","replacedBy":"24"},{"ruleId":"25","replacedBy":"26"},{"ruleId":"27","severity":1,"message":"28","line":24,"column":7,"nodeType":"29","messageId":"30","endLine":24,"endColumn":16},{"ruleId":"31","severity":1,"message":"32","line":122,"column":7,"nodeType":"33","endLine":122,"endColumn":88},{"ruleId":"23","replacedBy":"34"},{"ruleId":"25","replacedBy":"35"},"no-native-reassign",["36"],"no-negated-in-lhs",["37"],"no-unused-vars","'analytics' 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",["36"],["37"],"no-global-assign","no-unsafe-negation"]