diff --git a/diskuy/.eslintcache b/diskuy/.eslintcache index 712c9adc2454b191065cc94f65f92b1d7420c0d1..78bb6f8533530d4eb8e0edfb0b7fe498a5b157da 100644 --- a/diskuy/.eslintcache +++ b/diskuy/.eslintcache @@ -1 +1 @@ -[{"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"] \ No newline at end of file +[{"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"] diff --git a/diskuy/src/App.js b/diskuy/src/App.js index 330dd412e2fc61516ed3d184c022326da1a222fb..a513f2c59b54c30ea8facd3d356d9422e7e1d738 100644 --- a/diskuy/src/App.js +++ b/diskuy/src/App.js @@ -1,8 +1,9 @@ import './App.css'; -import Thread from './Thread'; +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> ); } diff --git a/diskuy/src/Button.js b/diskuy/src/Button.js index e7402bbcb40adc6ea5a4b8190726e37deef11d67..4510826fd176b007edccab613fd8fd655204f904 100644 --- a/diskuy/src/Button.js +++ b/diskuy/src/Button.js @@ -5,11 +5,15 @@ import { } from "react-router-dom" function Button(props) { + if(props.type=="button"){ return ( <Link to={`/${props.url}`}> <button className={`button ${props.color}`}>{props.text}</button> </Link> - ) + )} + else if(props.type=="input"){ + <input type="submit" value={props.text} className={`button ${props.color}`} /> + } } export default Button; \ No newline at end of file diff --git a/diskuy/src/Navbar.js b/diskuy/src/Navbar.js index 97376631ee7a896c32b869a498e80ed79cc156c2..1dcb814db18d926e33e70a668e692532aad8459c 100644 --- a/diskuy/src/Navbar.js +++ b/diskuy/src/Navbar.js @@ -8,17 +8,14 @@ import { const Navbar = () => { return ( <nav id = "navbar" className='navbar navbar-expand-lg navbar-light position-sticky fixed-top'> - <a className="navbar-brand" href=""> + <div className="navbar-brand"> <div className="d-flex align-items-center"> <Link to="/"><DiskuyLogo /></Link> </div> - </a> + </div> <ul className="navbar-nav ml-auto"> <li className="nav-item ml-auto"> - <Link to="/topic" className="nav-link"><b>Home</b></Link> - </li> - <li className="nav-item ml-auto"> - <Link to="/thread" className="nav-link"><b>Threads</b></Link> + <Link to="/topic" className="nav-link"><b>Threads</b></Link> </li> <li className="nav-item ml-auto"> <Link to="/profile" className="nav-link"><b>Profile</b></Link> diff --git a/diskuy/src/Profile.css b/diskuy/src/Profile/Profile.css similarity index 100% rename from diskuy/src/Profile.css rename to diskuy/src/Profile/Profile.css diff --git a/diskuy/src/Profile.js b/diskuy/src/Profile/Profile.js similarity index 95% rename from diskuy/src/Profile.js rename to diskuy/src/Profile/Profile.js index 3c4c9a1f7ef1a627ea546452617b31dbf274bb43..b093ad63ee9a87d29927683e29f5d1858ea771f9 100644 --- a/diskuy/src/Profile.js +++ b/diskuy/src/Profile/Profile.js @@ -1,6 +1,6 @@ import React from "react"; import './Profile.css'; -import Button from './Button'; +import Button from '../Button'; const Profile = () => { return ( diff --git a/diskuy/src/Comment.css b/diskuy/src/Threads/Comment.css similarity index 100% rename from diskuy/src/Comment.css rename to diskuy/src/Threads/Comment.css diff --git a/diskuy/src/Comment.js b/diskuy/src/Threads/Comment.js similarity index 100% rename from diskuy/src/Comment.js rename to diskuy/src/Threads/Comment.js diff --git a/diskuy/src/Threads/CreateThread.css b/diskuy/src/Threads/CreateThread.css new file mode 100644 index 0000000000000000000000000000000000000000..8b0d7feece2b1610aa5ca0df25ca310fa161d4c2 --- /dev/null +++ b/diskuy/src/Threads/CreateThread.css @@ -0,0 +1,28 @@ +.back { + margin-top: 32px; + margin-left: 72px; + color: #007A7A; +} + +.back h5 { + font-family: 'DM Sans'; + font-size: 18px; +} + +.header { + margin-top: 36px; + margin-left: 72px; +} + +.header h1 { + font-family: "DM Sans"; + font-size: 36px; + color: #003F5A; +} + +.form_section { + margin-top: 60px; + margin-left: 72px; + margin-right: 72px; +} + diff --git a/diskuy/src/Threads/CreateThread.js b/diskuy/src/Threads/CreateThread.js new file mode 100644 index 0000000000000000000000000000000000000000..15d94f2056cb445143ef3d3b3b9b61b674dddd66 --- /dev/null +++ b/diskuy/src/Threads/CreateThread.js @@ -0,0 +1,22 @@ +import React from "react"; +import './CreateThread.css'; +import FormCreateThread from './FormCreateThread' + + +function ListThreads() { + return ( + <div> + <div className="back"> + <h5>Back</h5> + </div> + <div className="header"> + <h1><b>Create a Thread</b></h1> + </div> + <div className="form_section"> + <FormCreateThread /> + </div> + </div> + ) +} + +export default ListThreads; \ No newline at end of file diff --git a/diskuy/src/Threads/FormCreateThread.css b/diskuy/src/Threads/FormCreateThread.css new file mode 100644 index 0000000000000000000000000000000000000000..473e01f2dc8599a603f42a5cd3dd2971fb572311 --- /dev/null +++ b/diskuy/src/Threads/FormCreateThread.css @@ -0,0 +1,6 @@ +.form_container { + display: flex; + flex-direction: column; +} + + diff --git a/diskuy/src/Threads/FormCreateThread.js b/diskuy/src/Threads/FormCreateThread.js new file mode 100644 index 0000000000000000000000000000000000000000..4031191c41fe05ee4f82d0ef643f47097662ecb4 --- /dev/null +++ b/diskuy/src/Threads/FormCreateThread.js @@ -0,0 +1,26 @@ +import React, { useState } from "react"; +import './FormCreateThread.css'; + +function FormCreateThread() { + + const {title, setTitle} = useState(''); + const {body, setBody} = useState(''); + + const sendForm = (e) => { + e.preventDefault(); + } + + return ( + <form onSubmit={sendForm}> + <div className="form_container"> + <label for="title">Title</label> + <input type="text" name="title" placeholder="Your threads title" required="false" /> + <label for="body">Body</label> + <textarea name="body" placeholder="Tulis" required="false" /> + <input type="submit" value="Create Thread" /> + </div> + </form> + ) +} + +export default FormCreateThread; \ No newline at end of file diff --git a/diskuy/src/Threads/ListThreads.css b/diskuy/src/Threads/ListThreads.css new file mode 100644 index 0000000000000000000000000000000000000000..ad0932ac16f896ad174a74c5fab8828dd58b88a1 --- /dev/null +++ b/diskuy/src/Threads/ListThreads.css @@ -0,0 +1,44 @@ +.header { + margin-top: 36px; + margin-left: 72px; +} + +.header h1 { + font-family: "DM Sans"; + font-size: 36px; + color: #007A7A; +} + +.list_threads_section { + display: flex; + flex-direction: column; + margin-top: 56px; + margin-left: 72px; + margin-right: 72px; +} + +.sub_header_list_threads { + display: flex; + justify-content: space-between; + align-items: center; +} + +.tab { + display: flex; + align-items: center; +} + +.tab h3 { + font-family: "DM Sans"; + font-size: 18px; + color: #000000; + margin-right: 24px; + margin-top: 4px; + opacity: 0.5; +} + +.tab .active { + color: #DE6600 !important; + font-weight: bold; + opacity: 1!important; +} \ No newline at end of file diff --git a/diskuy/src/Threads/ListThreads.js b/diskuy/src/Threads/ListThreads.js new file mode 100644 index 0000000000000000000000000000000000000000..5b69d61371d04542adf3636a40607984e9f94b2c --- /dev/null +++ b/diskuy/src/Threads/ListThreads.js @@ -0,0 +1,24 @@ +import React from "react"; +import './ListThreads.css'; +import Button from '../Button'; + +function ListThreads() { + return ( + <div> + <div className="header"> + <h1><b>Threads</b></h1> + </div> + <div className="list_threads_section"> + <div className="sub_header_list_threads"> + <div className="tab"> + <h3 className="active">Recent</h3> + <h3>Top</h3> + </div> + <Button text="Create Thread" color="orange" url="aaa" /> + </div> + </div> + </div> + ) +} + +export default ListThreads; \ No newline at end of file diff --git a/diskuy/src/Post.css b/diskuy/src/Threads/Post.css similarity index 100% rename from diskuy/src/Post.css rename to diskuy/src/Threads/Post.css diff --git a/diskuy/src/Post.js b/diskuy/src/Threads/Post.js similarity index 100% rename from diskuy/src/Post.js rename to diskuy/src/Threads/Post.js diff --git a/diskuy/src/Thread.css b/diskuy/src/Threads/Thread.css similarity index 100% rename from diskuy/src/Thread.css rename to diskuy/src/Threads/Thread.css diff --git a/diskuy/src/Thread.js b/diskuy/src/Threads/Thread.js similarity index 99% rename from diskuy/src/Thread.js rename to diskuy/src/Threads/Thread.js index 4e37e35c8b1d2f8dca0ecab853518fc3915f5fa8..6e74e6cd3dd0e9739ca38fb0baea90eb4f9b1b84 100644 --- a/diskuy/src/Thread.js +++ b/diskuy/src/Threads/Thread.js @@ -50,7 +50,7 @@ export default function Thread(props){ } function deleteComment(id) { - const newCommentList = comment.filter((value) => value.id != id); + const newCommentList = comment.filter((value) => value.id !== id); setComment(newCommentList); } diff --git a/diskuy/src/Topic.js b/diskuy/src/Topic.js index d26b316dae5c2851a77c29a7f94676a6c6d4338b..2343819d42525561bb77e61c44f40843815dd7cc 100644 --- a/diskuy/src/Topic.js +++ b/diskuy/src/Topic.js @@ -1,5 +1,11 @@ +<<<<<<< HEAD +import React, { useState } from "react"; +import Thread from './Threads/Thread' + +======= import React, { useEffect, useState } from "react"; import axios from 'axios' +>>>>>>> b787d09a38745fb5844d313f83e7237b86318391 import { Link } from "react-router-dom" const LINK = 'http://localhost:4000'; diff --git a/diskuy_back/config/dev.exs b/diskuy_back/config/dev.exs index 517b630d827d9a55611f84fe3669280726565714..9431975932ea1bfa54132d7ad7c5bebb5694f802 100644 --- a/diskuy_back/config/dev.exs +++ b/diskuy_back/config/dev.exs @@ -2,8 +2,8 @@ use Mix.Config # Configure your database config :diskuy, Diskuy.Repo, - username: "rafif", - password: "rafif123", + username: "postgres", + password: "animalkaiser15", database: "diskuy_dev", hostname: "localhost", show_sensitive_data_on_connection_error: true,