Skip to content

Commit 4390e40

Browse files
committed
Card layout
1 parent e440aca commit 4390e40

File tree

1 file changed

+38
-17
lines changed

1 file changed

+38
-17
lines changed

src/components/learn-aggregator/index.tsx

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface TeaserSectionProps {
1717
description: string
1818
href: string
1919
icon: string
20+
section: "getting-started" | "best-practices"
2021
}>
2122
firstIconsEager?: boolean
2223
}
@@ -48,6 +49,8 @@ export function TeaserSection({
4849
number={index + 1}
4950
title={item.title}
5051
description={item.description}
52+
href={item.href}
53+
section={item.section}
5154
icon={
5255
<img
5356
src={item.icon}
@@ -74,33 +77,51 @@ interface TeaserSectionListItemProps {
7477
description: string
7578
icon: ReactNode
7679
section: "getting-started" | "best-practices"
80+
href: string
7781
}
7882
function TeaserSectionListItem({
7983
number,
8084
title,
8185
description,
8286
icon,
8387
section,
88+
href,
8489
}: TeaserSectionListItemProps) {
8590
return (
86-
<li className="flex items-end gap-2 text-neu-900">
87-
<div
88-
className={clsx(
89-
section === "getting-started" && "bg-[#FFF5FD] dark:bg-pri-lighter/5",
90-
section === "best-practices" &&
91-
"bg-sec-lighter dark:bg-sec-lighter/5",
92-
)}
91+
<li className="text-neu-900">
92+
<a
93+
href={href}
94+
className="gql-focus-visible grid gap-x-3 gap-y-4 border border-neu-200 bg-neu-0 p-4 transition-colors [grid-template-areas:'icon_header''desc_desc'] [grid-template-columns:72px_1fr] [grid-template-rows:auto_auto] hover:border-neu-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 lg:gap-x-6 lg:gap-y-4 lg:p-0 lg:[grid-template-areas:'icon_header_arrow''icon_desc_arrow'] lg:[grid-template-columns:190px_1fr_64px]"
9395
>
94-
{icon}
95-
</div>
96-
<span>Lesson {number}</span>
97-
<strong className="typography-h3 font-normal">{title}</strong>
98-
<p className="typography-body-sm text-pretty p-4 text-neu-900">
99-
{description}
100-
</p>
101-
<div className="p-4 max-lg:hidden">
102-
<ArrowDownIcon className="size-8 shrink-0 -rotate-90" />
103-
</div>
96+
<div
97+
className={clsx(
98+
"flex size-[72px] items-center justify-center border border-neu-200 [grid-area:icon] lg:size-[190px]",
99+
section === "getting-started" &&
100+
"bg-pri-lighter/10 dark:bg-pri-lighter/5",
101+
section === "best-practices" &&
102+
"bg-sec-lighter dark:bg-sec-lighter/5",
103+
)}
104+
>
105+
{icon}
106+
</div>
107+
108+
<div className="flex flex-col gap-1 [grid-area:header] lg:gap-2 lg:px-4 lg:pt-4">
109+
<span className="typography-body-sm text-neu-700">
110+
Lesson {number}
111+
</span>
112+
<strong className="typography-h3 font-normal text-neu-900">
113+
{title}
114+
</strong>
115+
</div>
116+
117+
<p className="typography-body-sm text-pretty text-neu-900 [grid-area:desc] lg:px-4 lg:pb-4">
118+
{description}
119+
</p>
120+
121+
<div className="hidden items-center justify-center border-l border-t border-neu-200 [grid-area:arrow] lg:flex">
122+
<ArrowDownIcon className="size-8 shrink-0 -rotate-90" />
123+
</div>
124+
</a>
104125
</li>
105126
)
106127
}

0 commit comments

Comments
 (0)