Skip to content

Commit 4e5afa1

Browse files
committed
convert to astro component
1 parent 92c7d98 commit 4e5afa1

File tree

4 files changed

+25
-37
lines changed

4 files changed

+25
-37
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
export interface Props {
3+
title: string;
4+
id: string;
5+
}
6+
7+
const { title, id } = Astro.props;
8+
---
9+
10+
<details class="group mb-4">
11+
<summary
12+
aria-expanded="false"
13+
aria-controls={id}
14+
class="cursor-pointer flex justify-between p-2 rounded-md border-t border-b focus:ring-2"
15+
>
16+
<span class="font-semibold">{title}</span>
17+
<span aria-hidden="true" class="group-open:hidden">+</span>
18+
<span aria-hidden="true" class="group-open:block hidden">−</span>
19+
</summary>
20+
21+
<div id={id} class="pl-4">
22+
<slot />
23+
</div>
24+
</details>

src/components/accordion/accordion.tsx

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/components/accordion/index.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/pages/[...slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import BenefitItem from "../components/benefits-list/benefit-item.astro";
1414
import { ButtonWithTitle } from "../components/button-with-title";
1515
import { Note } from "../components/note";
1616
import { SponsorTiers } from "../components/sponsor-tiers";
17-
import { Accordion } from "../components/accordion";
17+
import Accordion from "../components/accordion/accordion.astro";
1818
1919
export async function getStaticPaths() {
2020
const posts = await getCollection("pages");

0 commit comments

Comments
 (0)