diff --git a/src/App.tsx b/src/App.tsx index 3694fdf..2e407da 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,6 @@ import { BrowserRouter, Route, Routes } from 'react-router-dom' import HomePage from './app/feed/pages/HomePage.tsx' +import PostPage from './app/feed/pages/PostPage.tsx' import SignupPage from './app/auth/pages/SignupPage.tsx' import LoginPage from './app/auth/pages/LoginPage.tsx' import LogoutPage from './app/auth/pages/LogoutPage.tsx' @@ -22,6 +23,10 @@ export default function App() { path={'/'} element={} /> + } + /> } /> } /> } /> diff --git a/src/app/feed/components/PostItem.tsx b/src/app/feed/components/PostItem.tsx index a0a541c..05fcbb3 100644 --- a/src/app/feed/components/PostItem.tsx +++ b/src/app/feed/components/PostItem.tsx @@ -1,13 +1,15 @@ import { Post, PostMedia } from '../posts/posts.ts' import { useEffect, useState } from 'react' +import { Link } from 'react-router-dom' interface PostItemProps { post: Post addReaction: (emoji: string) => void clearReaction: (emoji: string) => void + hideViewButton?: boolean } -export default function PostItem({ post, addReaction, clearReaction }: PostItemProps) { +export default function PostItem({ post, addReaction, clearReaction, hideViewButton = false }: PostItemProps) { const formattedDate = post.createdAt.toLocaleString('en-US', { year: 'numeric', month: 'short', @@ -31,6 +33,14 @@ export default function PostItem({ post, addReaction, clearReaction }: PostItemP
@{post.authorName}• {formattedDate} + {!hideViewButton && ( + <> + {' • '} + + View + + + )}
{post.content}
@@ -99,7 +109,7 @@ function PostReactionButton({ emoji, didReact, onClick, count }: PostReactionBut