2023-06-11 03:32:02 +00:00
|
|
|
<template>
|
2023-06-25 18:43:42 +00:00
|
|
|
<Shelf :shelf="shelf">
|
2023-06-25 17:52:00 +00:00
|
|
|
<div class="content">
|
|
|
|
<Post
|
|
|
|
:post="post"
|
|
|
|
:shelf="shelf"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<p
|
|
|
|
v-if="post.body"
|
|
|
|
class="body"
|
|
|
|
>{{ post.body }}</p>
|
|
|
|
|
|
|
|
<Writer
|
|
|
|
v-if="me"
|
|
|
|
:post="post"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div
|
|
|
|
v-else
|
|
|
|
class="body"
|
2023-06-11 03:32:02 +00:00
|
|
|
>
|
2023-06-25 17:52:00 +00:00
|
|
|
<a
|
|
|
|
href="/account/login"
|
|
|
|
class="link"
|
|
|
|
>Log in</a> or
|
|
|
|
<a
|
|
|
|
href="/account/create"
|
|
|
|
class="link"
|
|
|
|
>sign up</a> to comment
|
|
|
|
</div>
|
2023-06-11 03:32:02 +00:00
|
|
|
|
|
|
|
<ul class="comments nolist">
|
|
|
|
<li
|
|
|
|
v-for="comment in comments"
|
|
|
|
:key="comment.id"
|
2023-06-25 17:52:00 +00:00
|
|
|
>
|
|
|
|
<Comment
|
|
|
|
:comment="comment"
|
|
|
|
:post="post"
|
|
|
|
:shelf="shelf"
|
|
|
|
/>
|
|
|
|
</li>
|
2023-06-11 03:32:02 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
2023-06-25 18:43:42 +00:00
|
|
|
</Shelf>
|
2023-06-11 03:32:02 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
2023-06-25 18:43:42 +00:00
|
|
|
import Shelf from '../../templates/shelves/shelf.vue';
|
2023-06-11 03:32:02 +00:00
|
|
|
import Post from '../../components/posts/post.vue';
|
|
|
|
import Comment from '../../components/comments/comment.vue';
|
2023-06-25 17:52:00 +00:00
|
|
|
import Writer from '../../components/comments/writer.vue';
|
2023-06-11 03:32:02 +00:00
|
|
|
|
|
|
|
import { usePageContext } from '../../renderer/usePageContext';
|
|
|
|
|
2023-06-25 17:52:00 +00:00
|
|
|
const { me, pageData } = usePageContext();
|
2023-06-11 03:32:02 +00:00
|
|
|
|
|
|
|
const {
|
|
|
|
shelf,
|
|
|
|
post,
|
|
|
|
comments,
|
|
|
|
} = pageData;
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2023-06-25 17:52:00 +00:00
|
|
|
.content {
|
2023-06-25 21:50:08 +00:00
|
|
|
padding: 0;
|
2023-06-11 03:32:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.body {
|
2023-06-25 17:52:00 +00:00
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 1rem;
|
|
|
|
border-radius: .5rem;
|
|
|
|
margin: 0 0 .5rem 0;
|
|
|
|
background: var(--background);
|
2023-06-11 03:32:02 +00:00
|
|
|
}
|
|
|
|
|
2023-06-25 17:52:00 +00:00
|
|
|
.title {
|
|
|
|
margin: 0 0 .5rem 0;
|
2023-06-11 03:32:02 +00:00
|
|
|
}
|
|
|
|
|
2023-06-25 17:52:00 +00:00
|
|
|
.post {
|
2023-06-11 03:32:02 +00:00
|
|
|
margin-bottom: .5rem;
|
|
|
|
}
|
|
|
|
</style>
|