Skip to content

Commit

Permalink
Hide image viewer if there is no image
Browse files Browse the repository at this point in the history
  • Loading branch information
smrtrfszm committed Nov 13, 2023
1 parent a06271f commit 4ed2925
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const PostPage: VoidComponent = () => {
})

const searchLink = () => `/search/author/${data()!.post.author.id}`
const images = () => data()?.post.images ?? []
const images = () => data()?.post.images

return (
<>
Expand Down Expand Up @@ -58,9 +58,9 @@ const PostPage: VoidComponent = () => {
</div>
<img class={styles.indexImage} src={data()!.post.indexImage} alt="" />
<PageRenderer content={data()!.post.content} />
<Show when={!!images()}>
<Show when={images()!.length > 0}>
<div class={styles.imageViewerContainer}>
<ImageViewer images={images()} />
<ImageViewer images={images()!} />
</div>
</Show>
</div>
Expand Down

0 comments on commit 4ed2925

Please sign in to comment.