Skip to content

Commit cd692f5

Browse files
authored
Merge pull request #180 from Lemoncode/feature/#169-add-media-queries-for-provinces
style: update styles for desktop and add optional classname prop to the Card component
2 parents 8ad4a52 + fa6116d commit cd692f5

2 files changed

Lines changed: 23 additions & 14 deletions

File tree

front/src/common/components/card.component.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@ import React from "react";
22

33
interface Props {
44
children?: React.ReactNode;
5+
className?: string;
56
}
67

78
export const Card: React.FC<Props> = (props: Props) => {
8-
const { children } = props;
9+
const { children, className } = props;
910
return (
10-
<div className="bg-base-100 m-8 flex flex-col gap-6 rounded-2xl p-4">
11+
<div
12+
className={
13+
className
14+
? className
15+
: "bg-base-100 m-8 flex flex-col gap-6 rounded-2xl p-4"
16+
}
17+
>
1118
{children}
1219
</div>
1320
);

front/src/pods/embalse-provincia-list/embalse-provincia-list.component.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ import Link from "next/link";
55

66
export const EmbalseProvinciaList: React.FC = () => {
77
return (
8-
<Card>
9-
<h2>Embalses por provincias</h2>
10-
<div className="flex flex-col gap-4">
11-
{PROVINCIAS.map(({ id, name }) => (
12-
<Link
13-
key={id}
14-
href={`/embalse-provincia/${id}`}
15-
className="link-accessible"
16-
>
17-
{name}
18-
</Link>
19-
))}
8+
<Card className="mx-auto w-full pt-6 pr-4 pb-6 pl-4 md:max-w-[900px] md:p-8">
9+
<div className="bg-base-100 rounded-2xl p-6">
10+
<h2>Embalses por provincias</h2>
11+
<div className="grid grid-cols-1 gap-4 p-6 sm:grid-cols-2 md:grid-cols-3">
12+
{PROVINCIAS.map(({ id, name }) => (
13+
<Link
14+
key={id}
15+
href={`/embalse-provincia/${id}`}
16+
className="link-accessible"
17+
>
18+
{name}
19+
</Link>
20+
))}
21+
</div>
2022
</div>
2123
</Card>
2224
);

0 commit comments

Comments
 (0)