diff --git a/diskuy/src/Comment.js b/diskuy/src/Comment.js new file mode 100644 index 0000000000000000000000000000000000000000..7de38b22a002a03bbe7fff3e17f17358d2ee7950 --- /dev/null +++ b/diskuy/src/Comment.js @@ -0,0 +1,11 @@ +import './Comment.css'; + +export default function Comment(props){ + return ( + <div id="comment"> + <p id="creator">By {props.user} - Date</p> + <p id="isi">{props.text}</p> + <p className='inline'>{props.points}</p> + </div> + ) +} \ No newline at end of file diff --git a/diskuy/src/Thread.js b/diskuy/src/Thread.js new file mode 100644 index 0000000000000000000000000000000000000000..6d118293828c9187ab9fd9c1f074c290eda6d6d5 --- /dev/null +++ b/diskuy/src/Thread.js @@ -0,0 +1,38 @@ +import React, { useState } from "react"; +import './Thread.css'; +import Comment from './Comment'; +import Post from './Post'; + +const placeholder = [ + { + user: "abcd", + text: "Halohalohalohalo", + points: 10 + }, + { + user: "test123", + text: "SONOIHIGREGOEHOAI;HASD", + points: 20 + }, + { + user: "heiehe", + text: "IJCSIFHIFHIU", + points: 30 + }, +]; + +export default function Thread(props){ + const [comment, setComment] = useState(placeholder); + + return ( + <div> + <div> + <Post text="asdasfdgg" header="Berita Gembira" user="Hello guys David disini" points="100"/> + <p className='inline'>Comment</p> + </div> + {comment.map((value) => ( + <Comment text={value.text} user={value.user} points={value.points}/> + ))} + </div> + ) +} \ No newline at end of file