Skip to content

Commit c8a4da4

Browse files
add faqs components
1 parent c6aa0a8 commit c8a4da4

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed

src/components/Navbar.astro

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ import header from "../assets/images/header.png"
4949
<a href="/#organizadores" class="block py-1 px-4">Equipo</a>
5050
</li>
5151

52+
<li class="flex justify-center items-center">
53+
<a href="/#faqs" class="block py-1 px-4">Faqs</a>
54+
</li>
55+
5256
<li class="flex justify-center items-center">
5357
<a href="playground" class="block py-1 px-4">Playground ✨</a>
5458
</li>

src/components/faqs/FaqCard.astro

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
const { question, answer } = Astro.props;
3+
---
4+
5+
<details class="border py-8 [&_svg]:open:-rotate-180">
6+
<summary class="flex justify-between px-8 cursor-pointer">
7+
<span class="text-xl font-bold" title={question}>{question}</span>
8+
<svg
9+
fill="none"
10+
viewBox="0 0 24 24"
11+
stroke-width="1.5"
12+
stroke="currentColor"
13+
class="w-6 h-6 transition-all duration-200"
14+
>
15+
<path
16+
stroke-linecap="round"
17+
stroke-linejoin="round"
18+
d="m19.5 8.25-7.5 7.5-7.5-7.5"></path>
19+
</svg>
20+
</summary>
21+
<section class="px-8 mt-4 text-xl text-justify" title={answer}>
22+
{answer}
23+
</section>
24+
</details>

src/components/faqs/Faqs.astro

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
import faqs from "./faqs.json";
3+
import FaqCard from "./FaqCard.astro";
4+
---
5+
6+
<section id="faqs" class="bg-black text-white">
7+
<section class="max-w-screen-xl mx-auto px-4 py-16 space-y-8">
8+
<h2 class="text-2xl sm:text-3xl font-bold mx-auto">FAQs</h2>
9+
<h1 class="text-1xl sm:text-xl mx-auto">
10+
¿Tienes dudas? ¡Esperamos puedas despejarlas aquí!
11+
</h1>
12+
<section class="flex flex-col">
13+
{faqs.map((faq) => <FaqCard {...faq} />)}
14+
</section>
15+
</section>
16+
</section>

src/components/faqs/faqs.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{
3+
"question": "¿Pregunta 1?",
4+
"answer": "Respuesta 1"
5+
},
6+
{
7+
"question": "¿Pregunta 2?",
8+
"answer": "Respuesta 2"
9+
},
10+
{
11+
"question": "¿Pregunta 3?",
12+
"answer": "Respuesta 3"
13+
}
14+
]

src/pages/index.astro

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Layout from 'layouts/Layout.astro';
55
import Navbar from 'components/Navbar.astro';
66
import Organizers from 'components/organizers/Organizers.astro';
77
import Workshops from 'components/Workshops.astro';
8+
import Faqs from 'components/faqs/Faqs.astro';
89
---
910

1011
<Layout>
@@ -14,5 +15,6 @@ import Workshops from 'components/Workshops.astro';
1415
<AboutUs />
1516
<Workshops />
1617
<Organizers />
18+
<Faqs />
1719
</main>
1820
</Layout>

0 commit comments

Comments
 (0)