wip
This commit is contained in:
parent
36f5eef849
commit
dcaccc7ab8
5 changed files with 27 additions and 30 deletions
|
@ -5,6 +5,7 @@ import { useParams } from 'react-router-dom'
|
|||
import SingleColumnLayout from '../../../layouts/SingleColumnLayout.tsx'
|
||||
import NavBar from '../../../components/NavBar.tsx'
|
||||
import { useFeedViewModel } from '../components/FeedView.ts'
|
||||
import NavLinkButton from '../../../components/NavLinkButton.tsx'
|
||||
|
||||
interface AuthorPageParams {
|
||||
postsService: PostsService
|
||||
|
@ -23,7 +24,14 @@ export default function AuthorPage({ postsService }: AuthorPageParams) {
|
|||
const { pages, loadNextPage } = useFeedViewModel(fetchPosts)
|
||||
|
||||
return (
|
||||
<SingleColumnLayout navbar={<NavBar />}>
|
||||
<SingleColumnLayout
|
||||
navbar={
|
||||
<NavBar>
|
||||
<NavLinkButton to={'/'}>home</NavLinkButton>
|
||||
<NavLinkButton to="/logout">logout</NavLinkButton>
|
||||
</NavBar>
|
||||
}
|
||||
>
|
||||
<FeedView pages={pages} onLoadMore={loadNextPage} />
|
||||
</SingleColumnLayout>
|
||||
)
|
||||
|
|
|
@ -9,6 +9,7 @@ import { Post } from '../posts/posts.ts'
|
|||
import { Temporal } from '@js-temporal/polyfill'
|
||||
import SingleColumnLayout from '../../../layouts/SingleColumnLayout.tsx'
|
||||
import NavBar from '../../../components/NavBar.tsx'
|
||||
import NavLinkButton from '../../../components/NavLinkButton.tsx'
|
||||
|
||||
interface HomePageProps {
|
||||
postsService: PostsService
|
||||
|
@ -59,7 +60,13 @@ export default function HomePage({ postsService, mediaService }: HomePageProps)
|
|||
)
|
||||
|
||||
return (
|
||||
<SingleColumnLayout navbar={<NavBar />}>
|
||||
<SingleColumnLayout
|
||||
navbar={
|
||||
<NavBar>
|
||||
<NavLinkButton to="/logout">logout</NavLinkButton>
|
||||
</NavBar>
|
||||
}
|
||||
>
|
||||
<main className={`w-full max-w-3xl mx-auto`}>
|
||||
<NewPostWidget onSubmit={onCreatePost} isSubmitting={isSubmitting} />
|
||||
<FeedView pages={pages} onLoadMore={loadNextPage} />
|
||||
|
|
|
@ -42,7 +42,9 @@ export class PostsService {
|
|||
amount: number | null,
|
||||
): Promise<Post[]> {
|
||||
const response = await client.GET('/posts', {
|
||||
query: { cursor, amount, username },
|
||||
params: {
|
||||
query: { From: cursor ?? undefined, Amount: amount ?? undefined, Author: username },
|
||||
},
|
||||
credentials: 'include',
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue