diff --git a/diskuy/.eslintcache b/diskuy/.eslintcache index 94a7610ba1a7a09eb29f882cb502d8e13513ce7d..78bb6f8533530d4eb8e0edfb0b7fe498a5b157da 100644 --- a/diskuy/.eslintcache +++ b/diskuy/.eslintcache @@ -1,5 +1 @@ -<<<<<<< HEAD -[{"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\index.js":"1","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\reportWebVitals.js":"2","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\App.js":"3","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Navbar.js":"4","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Topic.js":"5","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Button.js":"6","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Profile\\Profile.js":"7","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Thread.js":"8","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Comment.js":"9","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Post.js":"10","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\ListThreads.js":"11","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\FormCreateThread.js":"12","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\CreateThread.js":"13"},{"size":517,"mtime":1608489407339,"results":"14","hashOfConfig":"15"},{"size":375,"mtime":1608489407340,"results":"16","hashOfConfig":"15"},{"size":759,"mtime":1609172445960,"results":"17","hashOfConfig":"15"},{"size":943,"mtime":1609148601770,"results":"18","hashOfConfig":"15"},{"size":582,"mtime":1609146276259,"results":"19","hashOfConfig":"15"},{"size":310,"mtime":1609103626391,"results":"20","hashOfConfig":"15"},{"size":725,"mtime":1609145816382,"results":"21","hashOfConfig":"15"},{"size":2441,"mtime":1609148441694,"results":"22","hashOfConfig":"15"},{"size":477,"mtime":1609146203278,"results":"23","hashOfConfig":"15"},{"size":514,"mtime":1609146174642,"results":"24","hashOfConfig":"15"},{"size":708,"mtime":1609150207131,"results":"25","hashOfConfig":"15"},{"size":789,"mtime":1609173549944,"results":"26","hashOfConfig":"15"},{"size":525,"mtime":1609172653602,"results":"27","hashOfConfig":"15"},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},"dzubz0",{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"39","usedDeprecatedRules":"30"},{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"52","messages":"53","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\index.js",[],["56","57"],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\reportWebVitals.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\App.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Navbar.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Topic.js",["58","59"],"import React, { useState } from \"react\";\r\nimport Thread from './Threads/Thread'\r\n\r\nimport { Link } from \"react-router-dom\"\r\n\r\nconst threads = [\r\n {\r\n id: 'thread1'\r\n },\r\n {\r\n id: 'thread2'\r\n }\r\n]\r\n\r\nexport default function Topic(props){\r\n const [thread, setThread] = useState(threads)\r\n\r\n return (\r\n <div>\r\n <ul>\r\n {thread.map((value) => (\r\n <li>\r\n <Link to={`/topic/${value.id}`}>{value.id}</Link>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n )\r\n}","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Button.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Profile\\Profile.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Thread.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Comment.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Post.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\ListThreads.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\FormCreateThread.js",["60","61","62","63"],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\CreateThread.js",[],{"ruleId":"64","replacedBy":"65"},{"ruleId":"66","replacedBy":"67"},{"ruleId":"68","severity":1,"message":"69","line":2,"column":8,"nodeType":"70","messageId":"71","endLine":2,"endColumn":14},{"ruleId":"68","severity":1,"message":"72","line":16,"column":20,"nodeType":"70","messageId":"71","endLine":16,"endColumn":29},{"ruleId":"68","severity":1,"message":"73","line":6,"column":12,"nodeType":"70","messageId":"71","endLine":6,"endColumn":17},{"ruleId":"68","severity":1,"message":"74","line":6,"column":19,"nodeType":"70","messageId":"71","endLine":6,"endColumn":27},{"ruleId":"68","severity":1,"message":"75","line":7,"column":12,"nodeType":"70","messageId":"71","endLine":7,"endColumn":16},{"ruleId":"68","severity":1,"message":"76","line":7,"column":18,"nodeType":"70","messageId":"71","endLine":7,"endColumn":25},"no-native-reassign",["77"],"no-negated-in-lhs",["78"],"no-unused-vars","'Thread' is defined but never used.","Identifier","unusedVar","'setThread' is assigned a value but never used.","'title' is assigned a value but never used.","'setTitle' is assigned a value but never used.","'body' is assigned a value but never used.","'setBody' is assigned a value but never used.","no-global-assign","no-unsafe-negation"] -======= [{"C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\index.js":"1","C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\reportWebVitals.js":"2","C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\App.js":"3","C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Topic.js":"4","C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Thread.js":"5","C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Profile.js":"6","C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Navbar.js":"7","C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Comment.js":"8","C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Button.js":"9","C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Post.js":"10"},{"size":500,"mtime":1608226437106,"results":"11","hashOfConfig":"12"},{"size":362,"mtime":1608226437230,"results":"13","hashOfConfig":"12"},{"size":515,"mtime":1609338774890,"results":"14","hashOfConfig":"12"},{"size":734,"mtime":1609487474112,"results":"15","hashOfConfig":"12"},{"size":2440,"mtime":1609338774894,"results":"16","hashOfConfig":"12"},{"size":724,"mtime":1609338774893,"results":"17","hashOfConfig":"12"},{"size":1101,"mtime":1609338774892,"results":"18","hashOfConfig":"12"},{"size":477,"mtime":1608492472838,"results":"19","hashOfConfig":"12"},{"size":310,"mtime":1609338774891,"results":"20","hashOfConfig":"12"},{"size":514,"mtime":1608492472844,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"jinzal",{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"31","messages":"32","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"33","usedDeprecatedRules":"24"},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"36","messages":"37","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"38","usedDeprecatedRules":"24"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\index.js",[],["45","46"],"C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\reportWebVitals.js",[],"C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\App.js",[],"C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Topic.js",[],"C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Thread.js",["47"],"import React, { useState } from \"react\";\r\nimport './Thread.css';\r\nimport Comment from './Comment';\r\nimport Post from './Post';\r\n\r\nconst placeholder = [\r\n {\r\n id:\"1\",\r\n user: \"abcd\",\r\n text: \"Halohalohalohalo\",\r\n points: 10\r\n }, \r\n {\r\n id:\"2\",\r\n user: \"test123\",\r\n text: \"SONOIHIGREGOEHOAI;HASD\",\r\n points: 20\r\n }, \r\n {\r\n id:\"3\",\r\n user: \"heiehe\",\r\n text: \"IJCSIFHIFHIU\",\r\n points: 30\r\n },\r\n];\r\n\r\n\r\nexport default function Thread(props){\r\n const [idGenerator, setIdGenerator] = useState(4);\r\n const [comment, setComment] = useState(placeholder);\r\n const [textArea, setTextArea] = useState('');\r\n\r\n function fillComment(event) {\r\n setTextArea(event.currentTarget.value);\r\n }\r\n\r\n function addComment() {\r\n let commentList = [...comment]\r\n commentList.push({\r\n id: idGenerator,\r\n user:\"tester\",\r\n text:textArea,\r\n points:0\r\n });\r\n const newId = idGenerator + 1\r\n setIdGenerator(newId);\r\n console.log(idGenerator);\r\n setComment(commentList);\r\n setTextArea('');\r\n }\r\n\r\n function deleteComment(id) {\r\n const newCommentList = comment.filter((value) => value.id != id);\r\n setComment(newCommentList);\r\n }\r\n\r\n return (\r\n <div>\r\n <div>\r\n <Post text=\"asdasfdgg\" header=\"Berita Gembira\" user=\"Hello guys David disini\" points=\"100\"/>\r\n <h2 className='commentText'>Comment</h2>\r\n </div>\r\n {comment.map((value) => (\r\n <div id=\"threadComment\">\r\n <Comment text={value.text} user={value.user} points={value.points}/>\r\n <button type=\"button\" className=\"btn btn-outline-danger deleteButton\" onClick={() => deleteComment(value.id)}>Delete</button>\r\n </div>\r\n ))}\r\n\r\n <div id=\"addCommentSection\">\r\n <h3>Add New Comment</h3>\r\n <textarea className=\"form-control commentBox\" cols=\"70\" rows=\"5\" \r\n onChange={(event) => fillComment(event)}\r\n value={textArea}> \r\n </textarea>\r\n <button className=\"btn btn-primary btn_cancel\" id=\"addCommentButton\" onClick={addComment}>Add Comment</button>\r\n </div>\r\n </div>\r\n )\r\n}","C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Profile.js",[],"C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Navbar.js",["48"],"import React from \"react\";\r\nimport {ReactComponent as DiskuyLogo} from './Logo.svg';\r\nimport './Navbar.css';\r\nimport {\r\n Link\r\n } from \"react-router-dom\"\r\n\r\nconst Navbar = () => {\r\n return (\r\n <nav id = \"navbar\" className='navbar navbar-expand-lg navbar-light position-sticky fixed-top'>\r\n <a className=\"navbar-brand\" href=\"\">\r\n <div className=\"d-flex align-items-center\">\r\n <Link to=\"/\"><DiskuyLogo /></Link>\r\n </div>\r\n </a>\r\n <ul className=\"navbar-nav ml-auto\">\r\n <li className=\"nav-item ml-auto\">\r\n <Link to=\"/topic\" className=\"nav-link\"><b>Home</b></Link>\r\n </li>\r\n <li className=\"nav-item ml-auto\">\r\n <Link to=\"/thread\" className=\"nav-link\"><b>Threads</b></Link>\r\n </li>\r\n <li className=\"nav-item ml-auto\">\r\n <Link to=\"/profile\" className=\"nav-link\"><b>Profile</b></Link>\r\n </li>\r\n </ul>\r\n </nav>\r\n );\r\n}\r\n\r\nexport default Navbar;\r\n","C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Comment.js",[],"C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Button.js",[],"C:\\Users\\ASUS\\Documents\\pemfung\\diskuy\\src\\Post.js",[],{"ruleId":"49","replacedBy":"50"},{"ruleId":"51","replacedBy":"52"},{"ruleId":"53","severity":1,"message":"54","line":53,"column":67,"nodeType":"55","messageId":"56","endLine":53,"endColumn":69},{"ruleId":"57","severity":1,"message":"58","line":11,"column":13,"nodeType":"59","endLine":11,"endColumn":49},"no-native-reassign",["60"],"no-negated-in-lhs",["61"],"eqeqeq","Expected '!==' and instead saw '!='.","BinaryExpression","unexpected","jsx-a11y/anchor-is-valid","The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md","JSXOpeningElement","no-global-assign","no-unsafe-negation"] ->>>>>>> b787d09a38745fb5844d313f83e7237b86318391 diff --git a/diskuy/src/App.js b/diskuy/src/App.js index 3e5067c60ce338b92e74d49c46b4715994cb31cb..a513f2c59b54c30ea8facd3d356d9422e7e1d738 100644 --- a/diskuy/src/App.js +++ b/diskuy/src/App.js @@ -2,7 +2,8 @@ import './App.css'; import Thread from './Threads/Thread'; import Topic from './Topic'; import Navbar from './Navbar'; -import Profile from './Profile'; +import Profile from './Profile/Profile'; +import ListThreads from './Threads/ListThreads'; import Form from './Form'; import TopicList from './TopicList'; import { @@ -21,6 +22,7 @@ function App() { <Route exact path='/:topic/thread/create' component={Form} /> <Route exact path='/:topic/:thread' component={Thread} /> <Route exact path='/:topic' component={Topic} /> + <Route exact path='/threads' component={ListThreads} /> </Router> ); }