diff options
Diffstat (limited to 'src/components/Thread.astro')
-rw-r--r-- | src/components/Thread.astro | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/components/Thread.astro b/src/components/Thread.astro index 6fae3de..7b60227 100644 --- a/src/components/Thread.astro +++ b/src/components/Thread.astro @@ -6,10 +6,9 @@ import Image from './Image.astro'; export interface Props { thread: Thread; board: string; - comments: boolean; } -const { thread, board, comments = false } = Astro.props; +const { thread, board } = Astro.props; let replies: string[] = []; const listReplies = (id: string, getReplies: boolean = false): any => { @@ -17,7 +16,7 @@ const listReplies = (id: string, getReplies: boolean = false): any => { replies = []; thread.comments.forEach(comment => { - if(comment.commentText.includes(id)) + if(comment.content.includes(id)) replies.push(comment.id); }) @@ -27,9 +26,9 @@ const listReplies = (id: string, getReplies: boolean = false): any => { --- {(thread.id != "rules") && ( <> - <Post id={thread.id} date={thread.creationDate} creator={thread.threadCreator} box="threadbox" board={(!comments) ? board : ''}> + <Post id={thread.id} date={thread.timestamp} box="threadbox" board={(thread.comments == undefined) ? board : ''}> - {comments && (listReplies(thread.id) && ( + {thread.comments != undefined && (listReplies(thread.id) && ( <span class="small-mono"> {listReplies(thread.id, true).map((id) => ( <> <a href=`/board/${board}/${thread.id}#${id}` onmouseover=`onMouseOver('${id}')` onmouseleave=`onMouseLeave('${id}')`>>>{id}</a> @@ -38,13 +37,13 @@ const listReplies = (id: string, getReplies: boolean = false): any => { ))} - <h3>{thread.threadName}</h3> - <Image image={thread.imageId} fileType={thread.fileType} /> - <p set:html={thread.threadText} /> + <h3>{thread.title}</h3> + <Image image={thread.image} fileType={thread.imagetype} /> + <p set:html={thread.content} /> - {comments && ( <> + {thread.comments != undefined && ( <> {thread.comments.map((comment) => ( <> - <Post id={comment.id} date={comment.creationDate} creator={comment.commentCreator} box="commentbox"> + <Post id={comment.id} date={comment.timestamp} box="commentbox"> {listReplies(comment.id) && ( <span class="small-mono"> @@ -54,8 +53,8 @@ const listReplies = (id: string, getReplies: boolean = false): any => { </span> <hr> )} - <Image image={comment.imageId} fileType={comment.fileType} /> - <p set:html={comment.commentText} /> + <Image image={comment.image} fileType={comment.imagetype} /> + <p set:html={comment.content} /> </Post> </> ))} @@ -64,7 +63,7 @@ const listReplies = (id: string, getReplies: boolean = false): any => { </Post> </> )} -{comments && ( <> +{thread.comments != undefined && ( <> <script is:inline> function onMouseOver(id) { document.getElementById(id).classList.add('targeted'); |