Fakultas Ilmu Komputer UI

Commit 4b7a84dd authored by jonathanchandra15's avatar jonathanchandra15
Browse files

fix post.js

parents 5ede3057 08940841
[{"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\\TopicList.js":"4","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\RegisterForm.js":"5","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\LoginForm.js":"6","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\CreateTopicForm.js":"7","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Topic.js":"8","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Navbar.js":"9","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Search.js":"10","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\ListThreads.js":"11","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Profile\\Profile.js":"12","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Thread.js":"13","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\loggedInService.js":"14","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\api_link.js":"15","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\auth.service.js":"16","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\auth-header.js":"17","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\hooks\\input-hook.js":"18","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\CommentList.js":"19","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Button.js":"20","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Post.js":"21","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\helpers\\time-util.js":"22","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\TopThreads.js":"23","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\PreviewThread.js":"24","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\RecentThreads.js":"25","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\CreateThread.js":"26","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\FormCreateThread.js":"27","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\EditThread.js":"28","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\FormEditThread.js":"29"},{"size":517,"mtime":1608489407339,"results":"30","hashOfConfig":"31"},{"size":375,"mtime":1608489407340,"results":"32","hashOfConfig":"31"},{"size":1597,"mtime":1610534118377,"results":"33","hashOfConfig":"31"},{"size":1225,"mtime":1610538246495,"results":"34","hashOfConfig":"31"},{"size":3505,"mtime":1610536658090,"results":"35","hashOfConfig":"31"},{"size":2840,"mtime":1610536107826,"results":"36","hashOfConfig":"31"},{"size":1118,"mtime":1610508966367,"results":"37","hashOfConfig":"31"},{"size":2036,"mtime":1610539390632,"results":"38","hashOfConfig":"31"},{"size":2515,"mtime":1610529895964,"results":"39","hashOfConfig":"31"},{"size":1387,"mtime":1610448859126,"results":"40","hashOfConfig":"31"},{"size":2275,"mtime":1610450399349,"results":"41","hashOfConfig":"31"},{"size":2665,"mtime":1610536072547,"results":"42","hashOfConfig":"31"},{"size":4254,"mtime":1610531118152,"results":"43","hashOfConfig":"31"},{"size":103,"mtime":1610376399652,"results":"44","hashOfConfig":"31"},{"size":115,"mtime":1610376399606,"results":"45","hashOfConfig":"31"},{"size":1011,"mtime":1610376399638,"results":"46","hashOfConfig":"31"},{"size":209,"mtime":1610376399607,"results":"47","hashOfConfig":"31"},{"size":374,"mtime":1609624159225,"results":"48","hashOfConfig":"31"},{"size":709,"mtime":1610376399571,"results":"49","hashOfConfig":"31"},{"size":310,"mtime":1609672020693,"results":"50","hashOfConfig":"31"},{"size":3724,"mtime":1610530203004,"results":"51","hashOfConfig":"31"},{"size":1120,"mtime":1610376399581,"results":"52","hashOfConfig":"31"},{"size":1431,"mtime":1610529896674,"results":"53","hashOfConfig":"31"},{"size":721,"mtime":1610529896375,"results":"54","hashOfConfig":"31"},{"size":1389,"mtime":1610529896528,"results":"55","hashOfConfig":"31"},{"size":707,"mtime":1610518272862,"results":"56","hashOfConfig":"31"},{"size":3016,"mtime":1610533855446,"results":"57","hashOfConfig":"31"},{"size":765,"mtime":1610534319072,"results":"58","hashOfConfig":"31"},{"size":3185,"mtime":1610534461362,"results":"59","hashOfConfig":"31"},{"filePath":"60","messages":"61","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},"3m9re2",{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"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,"usedDeprecatedRules":"62"},{"filePath":"79","messages":"80","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"81","messages":"82","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"83","messages":"84","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"85","usedDeprecatedRules":"62"},{"filePath":"86","messages":"87","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"88","messages":"89","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"90","messages":"91","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"94","messages":"95","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"96","messages":"97","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"98","messages":"99","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"102","messages":"103","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"104","messages":"105","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"106","messages":"107","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"108","messages":"109","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"110","usedDeprecatedRules":"62"},{"filePath":"111","messages":"112","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"113","messages":"114","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"62"},{"filePath":"115","messages":"116","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"117","messages":"118","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"119","messages":"120","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\index.js",[],["121","122"],"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\\TopicList.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\RegisterForm.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\LoginForm.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\CreateTopicForm.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Topic.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Navbar.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Search.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\ListThreads.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Profile\\Profile.js",["123","124","125"],"import React, { useState, useEffect } from \"react\";\r\nimport './Profile.css';\r\nimport Button from '../Button';\r\nimport ThreadList from '../Threads/PreviewThread'\r\nimport axios from \"axios\";\r\nimport AuthService from '../services/auth.service'\r\nimport { API_URL } from '../services/api_link'\r\nimport { Link } from \"react-router-dom\"\r\n\r\nfunction Profile(props) {\r\n const userId = AuthService.getCurrentUserId();\r\n const profileId = props.match.params.user;\r\n const [user, setUser] = useState({\r\n id:\"\",\r\n name:\"\",\r\n username: \"\"\r\n });\r\n const [usersThreads, setUsersThreads] = useState([]);\r\n\r\n useEffect(() => {\r\n async function getUsersThreads(profileId) {\r\n const allThreads = await axios.get(`${API_URL}/threads`);\r\n const usersThreads = allThreads.data.data.filter(thread => thread.user_id == profileId);\r\n\r\n const getUser = await axios.get(`${API_URL}/users/${profileId}`);\r\n const currentUser = getUser.data.data;\r\n\r\n setUsersThreads(usersThreads);\r\n setUser(currentUser);\r\n }\r\n getUsersThreads(profileId);\r\n }, [userId]);\r\n\r\n\r\n return (\r\n <div>\r\n <div className=\"header\">\r\n <h1><b>Profile</b></h1>\r\n </div>\r\n <div className=\"profile_section\">\r\n <div className=\"userIcon\">\r\n <i class=\"far fa-user-circle icon\"></i>\r\n </div>\r\n <h2><b>{user.username}</b></h2>\r\n </div>\r\n <div className=\"my_threads_section\">\r\n <div className=\"sub_header_my_threads\">\r\n <h3><b>Threads Created by {user.username}</b></h3>\r\n\r\n {userId == profileId && (\r\n <Button text=\"Create Thread\" color=\"orange\" url=\"create/thread\" />\r\n )}\r\n\r\n </div>\r\n <div className=\"list_threads\">\r\n {usersThreads.map((thread) => (\r\n <Link to={`/topic/${thread.topic_name}/${thread.id}`}>\r\n <ThreadList\r\n header={thread.title}\r\n user={thread.username}\r\n points={thread.points}\r\n time={thread.updated_at}\r\n topic={thread.topic_name}\r\n user_id={thread.user_id}>\r\n </ThreadList>\r\n </Link>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport default Profile;","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Thread.js",["126","127"],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\loggedInService.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\api_link.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\auth.service.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\services\\auth-header.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\hooks\\input-hook.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\CommentList.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Button.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\Post.js",["128"],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\helpers\\time-util.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\TopThreads.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\PreviewThread.js",["129"],"import './PreviewThread.css';\r\nimport { tConvert, translate } from '../helpers/time-util'\r\n\r\n\r\nexport default function ThreadList(props){\r\n const time = translate(props.time)\r\n return (\r\n <div id=\"threadCard\">\r\n <div id=\"threadCardHeader\">\r\n <h2 id=\"judul\"><b>{props.header}</b></h2>\r\n </div>\r\n <p id=\"topic\">{props.topic}</p>\r\n <div id=\"threadCardContent\">\r\n <p>By {props.user} - {time} - <i class=\"far fa-thumbs-up\"></i> {props.points}</p>\r\n </div>\r\n </div>\r\n )\r\n}","F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\RecentThreads.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\CreateThread.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\FormCreateThread.js",["130","131"],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\EditThread.js",[],"F:\\Jonathan\\Kuliah\\Pemfung\\diskuy\\diskuy\\src\\Threads\\FormEditThread.js",["132","133"],{"ruleId":"134","replacedBy":"135"},{"ruleId":"136","replacedBy":"137"},{"ruleId":"138","severity":1,"message":"139","line":23,"column":87,"nodeType":"140","messageId":"141","endLine":23,"endColumn":89},{"ruleId":"142","severity":1,"message":"143","line":32,"column":8,"nodeType":"144","endLine":32,"endColumn":16,"suggestions":"145"},{"ruleId":"138","severity":1,"message":"139","line":50,"column":29,"nodeType":"140","messageId":"141","endLine":50,"endColumn":31},{"ruleId":"138","severity":1,"message":"139","line":53,"column":105,"nodeType":"140","messageId":"141","endLine":53,"endColumn":107},{"ruleId":"138","severity":1,"message":"139","line":66,"column":43,"nodeType":"140","messageId":"141","endLine":66,"endColumn":45},{"ruleId":"146","severity":1,"message":"147","line":3,"column":8,"nodeType":"148","messageId":"149","endLine":3,"endColumn":19},{"ruleId":"146","severity":1,"message":"150","line":2,"column":10,"nodeType":"148","messageId":"149","endLine":2,"endColumn":18},{"ruleId":"146","severity":1,"message":"151","line":36,"column":19,"nodeType":"148","messageId":"149","endLine":36,"endColumn":24},{"ruleId":"138","severity":1,"message":"139","line":36,"column":105,"nodeType":"140","messageId":"141","endLine":36,"endColumn":107},{"ruleId":"142","severity":1,"message":"152","line":34,"column":8,"nodeType":"144","endLine":34,"endColumn":23,"suggestions":"153"},{"ruleId":"138","severity":1,"message":"139","line":48,"column":105,"nodeType":"140","messageId":"141","endLine":48,"endColumn":107},"no-native-reassign",["154"],"no-negated-in-lhs",["155"],"eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'profileId'. Either include it or remove the dependency array.","ArrayExpression",["156"],"no-unused-vars","'AuthService' is defined but never used.","Identifier","unusedVar","'tConvert' is defined but never used.","'topic' is assigned a value but never used.","React Hook useEffect has missing dependencies: 'setBody', 'setTitle', and 'setTopicId'. Either include them or remove the dependency array.",["157"],"no-global-assign","no-unsafe-negation",{"desc":"158","fix":"159"},{"desc":"160","fix":"161"},"Update the dependencies array to be: [profileId, userId]",{"range":"162","text":"163"},"Update the dependencies array to be: [setBody, setTitle, setTopicId, threadIdParam]",{"range":"164","text":"165"},[1144,1152],"[profileId, userId]",[1418,1433],"[setBody, setTitle, setTopicId, threadIdParam]"]
\ No newline at end of file
......@@ -74,7 +74,9 @@ export default function Post(props){
)}
</div>
<div id="postContent">
<h1 id="judul">{props.header}</h1>
{props.type == "thread" && (
<h1 id="judul">{props.header}</h1>
)}
<p id="isi">{props.text}</p>
<div className="likeSection">
{loggedIn && (
......
......@@ -21,7 +21,7 @@
.sub_header_list_threads {
display: flex;
justify-content: space-between;
justify-content: space-evenly;
align-items: center;
margin-bottom: 28px;
margin-right: 72px;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment