diff --git a/src/components/PostList.vue b/src/components/PostList.vue
new file mode 100644
index 0000000..e41fc7d
--- /dev/null
+++ b/src/components/PostList.vue
@@ -0,0 +1,55 @@
+
+
+
+
+
+
diff --git a/src/components/PostOrRepost.vue b/src/components/PostOrRepost.vue
index 4aca222..b2539d4 100644
--- a/src/components/PostOrRepost.vue
+++ b/src/components/PostOrRepost.vue
@@ -37,4 +37,8 @@ function onPostDeleted(postId: string) {
.action {
@include post-action;
}
+
+.post {
+ margin-bottom: $block-outer-padding;
+}
diff --git a/src/router/index.ts b/src/router/index.ts
index 68df330..165c072 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -2,12 +2,12 @@ import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router"
import AboutPage from "@/views/About.vue"
import AboutPublicPage from "@/views/AboutPublic.vue"
+import HomeTimeline from "@/views/HomeTimeline.vue"
import LandingPage from "../views/LandingPage.vue"
import NotificationList from "../views/NotificationList.vue"
import ProfileDirectory from "../views/ProfileDirectory.vue"
import ProfileView from "@/views/Profile.vue"
import ProfileForm from "@/views/ProfileForm.vue"
-import PostList from "@/views/PostList.vue"
import PostDetail from "@/views/PostDetail.vue"
import PostOverlay from "@/views/PostOverlay.vue"
import TagTimeline from "@/views/TagTimeline.vue"
@@ -53,7 +53,7 @@ const routes: Array = [
{
path: "/home",
name: "home",
- component: PostList,
+ component: HomeTimeline,
meta: { onlyAuthenticated: true },
},
{
diff --git a/src/views/PostList.vue b/src/views/HomeTimeline.vue
similarity index 51%
rename from src/views/PostList.vue
rename to src/views/HomeTimeline.vue
index 3507165..75a0391 100644
--- a/src/views/PostList.vue
+++ b/src/views/HomeTimeline.vue
@@ -2,19 +2,7 @@
-
-
+
@@ -23,23 +11,22 @@
diff --git a/src/views/TagTimeline.vue b/src/views/TagTimeline.vue
index c5abb61..69167e9 100644
--- a/src/views/TagTimeline.vue
+++ b/src/views/TagTimeline.vue
@@ -1,19 +1,10 @@
-
-
+
@@ -24,12 +15,10 @@
import { ref, onMounted } from "vue"
import { useRoute } from "vue-router"
-import { PAGE_SIZE } from "@/api/common"
import { Post, getTagTimeline } from "@/api/posts"
-import PostOrRepost from "@/components/PostOrRepost.vue"
+import PostList from "@/components/PostList.vue"
import Sidebar from "@/components/Sidebar.vue"
import { useCurrentUser } from "@/store/user"
-import { formatDate } from "@/utils/format"
const route = useRoute()
const posts = ref([])
@@ -42,32 +31,13 @@ onMounted(async () => {
)
})
-function onPostDeleted(postId: string) {
- const postIndex = posts.value.findIndex((post) => post.id === postId)
- posts.value.splice(postIndex, 1)
-}
-
-function isPageFull(): boolean {
- return posts.value.length >= PAGE_SIZE
-}
-
-async function loadNextPage() {
- if (posts.value.length > 0) {
- const { authToken } = useCurrentUser()
- const newPosts = await getTagTimeline(
- authToken.value,
- route.params.tagName,
- posts.value[posts.value.length - 1].id,
- )
- posts.value.push(...newPosts)
- }
+async function loadNextPage(maxId: string) {
+ const { authToken } = useCurrentUser()
+ const newPosts = await getTagTimeline(
+ authToken.value,
+ route.params.tagName,
+ maxId,
+ )
+ posts.value.push(...newPosts)
}
-
-