Skip to content

Commit

Permalink
aligned the images
Browse files Browse the repository at this point in the history
  • Loading branch information
hetk987 committed Nov 9, 2024
1 parent d16c630 commit 3d2ba7d
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions my-turborepo/apps/nextjs/src/app/challenges/helpers/Prizes.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
import Image from "next/image";

import Heading from "~/app/challenges/helpers/Heading";

interface prizeSchema {
name: string;
img_url?: string;
}

const places = ["1st", "2nd", "3rd", "4th", "5th"];

export default function Prizes({ prizes }: { prizes: prizeSchema[] }) {
return (
<div className="flex flex-row w-full gap-4">
<div className="flex flex-row w-full justify-between items-stretch p-10 text-center">
{prizes.map((prize, index) => {
return (
<div className="flex flex-col">
<Heading>{places[index] + " place: " + prize.name}</Heading>
{prize.img_url && (
<Image
width={300}
height={300}
src={prize.img_url}
alt={"Challenge Prize"}
/>
)}
<div key={index} className="flex flex-col items-center w-full">
<Heading className="flex text-center items-center mb-2 ">
{places[index] + " place: " + prize.name}
</Heading>
<div className="flex-grow flex items-center justify-center w-full px-2">
{prize.img_url && (
<Image
width={300}
height={300}
src={prize.img_url}
alt={"Challenge Prize"}
className="max-w-full max-h-full object-contain"
/>
)}
</div>
</div>
);
})}
Expand Down

0 comments on commit 3d2ba7d

Please sign in to comment.