Skip to content

Commit b66b55b

Browse files
authored
feat: improve mobile layout for materials (#121)
1 parent cfeb10f commit b66b55b

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/components/home/materials.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Link from "next/link"
22
import { FiArrowUpRight, FiBook, FiBookOpen, FiClipboard, FiFileText, FiUploadCloud } from "react-icons/fi"
33
import { CardIcon } from "@/components/card-icon"
44
import { Button } from "@/components/ui/button"
5+
import { CardCaption } from "../card-caption"
56

67
const featuredCards = [
78
{
@@ -31,13 +32,19 @@ const quickLinks = [
3132
export function Materials() {
3233
return (
3334
<section className="mx-auto flex max-w-400 flex-col-reverse gap-24 p-11 py-28 sm:px-20 2xl:flex-row 2xl:items-start 2xl:gap-32">
34-
<div className="flex grow flex-col gap-5 sm:gap-6 2xl:gap-8 2xl:pt-44">
35-
<div className="grid gap-4 sm:grid-cols-2 sm:gap-12 2xl:gap-20">
36-
{/* TODO sotto sm usare le altre card fatte da Diubi */}
35+
<div className="flex grow flex-col gap-4 sm:gap-6 2xl:gap-8 2xl:pt-44">
36+
{/* Desktop Cards */}
37+
<div className="hidden gap-4 sm:grid sm:grid-cols-2 sm:gap-12 2xl:gap-20">
3738
{featuredCards.map((card) => (
3839
<CardIcon key={card.title} {...card} className="h-full" />
3940
))}
4041
</div>
42+
{/* Mobile Cards */}
43+
<div className="flex flex-col items-center gap-4 sm:hidden">
44+
{featuredCards.map((card) => (
45+
<CardCaption key={card.title} {...card} caption={card.description} className="h-full w-fit" />
46+
))}
47+
</div>
4148

4249
<div className="grid grid-cols-3 gap-4 sm:gap-12 2xl:gap-20">
4350
{quickLinks.map((card) => (

0 commit comments

Comments
 (0)