Skip to content

Commit

Permalink
fix: ensure consistent post width
Browse files Browse the repository at this point in the history
  • Loading branch information
kguzek authored and Octopus4344 committed Feb 15, 2025
1 parent 3ce124b commit e897255
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/app/news/components/post-attachments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ function PostAttachment({ attachment }: { attachment: FacebookAttachment }) {
) : (
<Image
src={attachment.media.image.src}
alt={"Facebook post image attachment"}
className="my-4"
alt="Facebook post image attachment"
className="my-4 basis-full"
width={800}
height={0}
/>
)}
{/* @solvro/config forced me into doing !! on a boolean */}
{!!hasSubAttachments && (
{hasSubAttachments ? (
<Button
className="order-2 ml-3"
onClick={() => {
Expand All @@ -33,7 +32,7 @@ function PostAttachment({ attachment }: { attachment: FacebookAttachment }) {
>
{showSubAttachments ? "Mniej" : "Więcej"} zdjęć
</Button>
)}
) : null}
</>
);
}
Expand Down
9 changes: 5 additions & 4 deletions src/app/news/components/post.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Image from "next/image";
import Link from "next/link";

import type { FacebookPost, FacebookUser } from "@/lib/types";

Expand All @@ -15,20 +16,20 @@ export function Post({
return (
<div className="m-3 mt-0 rounded-xl border p-3 text-sm md:m-10 md:mt-0 md:w-2/3 md:text-base xl:w-1/2">
<div className="mb-3 flex items-center">
<a href={author.link} target="_blank" rel="noopener noreferrer">
<Link href={author.link} target="_blank" rel="noopener noreferrer">
<Image
src={author.picture.data.url}
alt={author.name}
width={author.picture.data.width}
height={author.picture.data.height}
className="rounded-full"
/>
</a>
</Link>
<div className="ml-2 w-full">
<p className="font-semibold">
<a href={author.link} target="_blank" rel="noopener noreferrer">
<Link href={author.link} target="_blank" rel="noopener noreferrer">
{author.name}
</a>
</Link>
</p>
<p
className="flex items-center gap-1 text-xs text-gray-500 md:text-sm"
Expand Down
2 changes: 1 addition & 1 deletion src/app/news/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async function FbPage() {
) : posts.length === 0 ? (
<NewsErrorMessage type="noPosts" />
) : (
<div className="flex flex-col items-stretch md:items-center">
<div className="flex w-full flex-col items-stretch md:items-center">
{posts.map((post) => (
<Post key={post.id} post={post} author={user} />
))}
Expand Down

0 comments on commit e897255

Please sign in to comment.