Skip to content

Commit

Permalink
clean up max width
Browse files Browse the repository at this point in the history
  • Loading branch information
nofurtherinformation committed Aug 7, 2024
1 parent e865024 commit 5a91186
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions app/posts/[post]/Renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@ export const PostRenderer: React.FC<{ content: any }> = ({ content }) => {
const cleanDate = date && new Date(date).toLocaleDateString()
if (content instanceof Error)
return (
<div className="prose m-auto my-12">
<div
className="prose m-auto my-12 w-full"
style={{
maxWidth: "min(100vw - 2rem, 1400px)",
}}
>
<h1>Unable to find post</h1>
<a href="/posts">Back to list of posts</a>
<br />
<a href="/">Home</a>
</div>
)
return (
<div className="prose m-auto my-12">
<div
className="prose m-auto my-12"
style={{
maxWidth: "min(100vw - 2rem, 1024px)",
}}
>
<h1>{title}</h1>
{author && (
<p>
Expand All @@ -24,7 +34,11 @@ export const PostRenderer: React.FC<{ content: any }> = ({ content }) => {
</i>
</p>
)}
<Image src={mainImage} alt={title} width={800} height={400} />
<Image src={mainImage} alt={title} width={800} height={400}
style={{
margin: "0 auto"
}}
/>
<PostMarkdown content={body} />
</div>
)
Expand Down

0 comments on commit 5a91186

Please sign in to comment.