buttons
This commit is contained in:
parent
abd7c2f073
commit
384da1e832
18 changed files with 150 additions and 116 deletions
|
@ -9,7 +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'
|
||||
import AuthNavButtons from '../../auth/components/AuthNavButtons.tsx'
|
||||
|
||||
interface HomePageProps {
|
||||
postsService: PostsService
|
||||
|
@ -18,7 +18,6 @@ interface HomePageProps {
|
|||
|
||||
export default function HomePage({ postsService, mediaService }: HomePageProps) {
|
||||
const { user } = useUser()
|
||||
|
||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||
|
||||
const fetchPosts = useCallback(
|
||||
|
@ -59,16 +58,18 @@ export default function HomePage({ postsService, mediaService }: HomePageProps)
|
|||
[mediaService, postsService, setPages, user],
|
||||
)
|
||||
|
||||
const isLoggedIn = user != null
|
||||
|
||||
return (
|
||||
<SingleColumnLayout
|
||||
navbar={
|
||||
<NavBar>
|
||||
<NavLinkButton to="/logout">logout</NavLinkButton>
|
||||
<AuthNavButtons />
|
||||
</NavBar>
|
||||
}
|
||||
>
|
||||
<main className={`w-full max-w-3xl mx-auto`}>
|
||||
<NewPostWidget onSubmit={onCreatePost} isSubmitting={isSubmitting} />
|
||||
{isLoggedIn && <NewPostWidget onSubmit={onCreatePost} isSubmitting={isSubmitting} />}
|
||||
<FeedView pages={pages} onLoadMore={loadNextPage} />
|
||||
</main>
|
||||
</SingleColumnLayout>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue