Skip to content

Commit 69d937e

Browse files
authored
Enhance CollagePreview with dark mode support
Added dark mode support and improved styling.
1 parent 06701c8 commit 69d937e

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

frontend/src/components/Collage/CollagePreview.tsx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ interface CollagePreviewProps {
66
layout: LayoutType;
77
}
88

9-
const CollagePreview: React.FC<CollagePreviewProps> = ({
10-
images,
11-
layout,
12-
}) => {
9+
const CollagePreview: React.FC<CollagePreviewProps> = ({ images, layout }) => {
1310
const config = getLayout(layout);
14-
15-
// FIX: Constrain images to the lesser of maxImages or available placements array length (Addressing placement error)
1611
const showImages = images.slice(0, Math.min(config.maxImages, config.placements.length));
1712

1813
return (
19-
<div className="w-full h-[420px] rounded-xl overflow-hidden p-2 bg-white">
14+
<div className="w-full h-[420px] rounded-xl overflow-hidden p-2
15+
bg-white dark:bg-gray-800
16+
border border-gray-200 dark:border-gray-700">
17+
2018
<div
2119
className="grid h-full w-full gap-2"
2220
style={{
@@ -26,21 +24,16 @@ const CollagePreview: React.FC<CollagePreviewProps> = ({
2624
>
2725
{showImages.map((img, index) => {
2826
const p = config.placements[index];
29-
3027
return (
3128
<div
3229
key={index}
3330
style={{
3431
gridColumn: `${p.colStart} / ${p.colEnd}`,
3532
gridRow: `${p.rowStart} / ${p.rowEnd}`,
3633
}}
37-
className="rounded-xl overflow-hidden bg-gray-100"
34+
className="rounded-xl overflow-hidden bg-gray-100 dark:bg-gray-700"
3835
>
39-
<img
40-
src={img}
41-
alt={`Collage image ${index + 1}`}
42-
className="w-full h-full object-cover"
43-
/>
36+
<img src={img} className="w-full h-full object-cover" />
4437
</div>
4538
);
4639
})}
@@ -50,4 +43,3 @@ const CollagePreview: React.FC<CollagePreviewProps> = ({
5043
};
5144

5245
export default CollagePreview;
53-

0 commit comments

Comments
 (0)