Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/components/Questions.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
interface Question {
question: string;
answer: string;
}

export interface Props {
id?: string;
title?: string;
subtitle?: string;
questions: Question[];
}

const { id = 'questions', questions } = Astro.props as Props;
---

<section id={id} class="scroll-mt-28 py-16 sm:py-20 md:py-24" aria-labelledby={`${id}-title`}>
<div class="flex flex-col items-start text-white md:mx-40 mx-6">
{
questions.map((question) => (
<details class="p-2 group">
<summary class="cursor-pointer list-none">
<span class="md:text-2xl text-lg">{question.question}</span>
<span class="ml-2 text-3xl transition-transform duration-200">
<span class="group-open:hidden">+</span>
<span class="hidden group-open:inline">−</span>
</span>
</summary>

<div class="py-4 md:px-16 px-6 md:text-base text-sm">
<p>{question.answer}</p>
</div>
</details>
))
}
</div>
</section>
9 changes: 8 additions & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
import Layout from '../layouts/Layout.astro';
import Hero from '../components/Hero.astro';
import Sponsors from '../components/Sponsors.astro';
import AboutUs from '../components/AboutUs.astro';
import Schedule from '../components/Schedule.astro';
import AboutUs from '../components/AboutUs.astro';
import Questions from '../components/Questions.astro';

// Welcome to Astro! Wondering what to do next? Check out the Astro documentation at https://docs.astro.build
// Don't want to use any of this? Delete everything in this file, the `assets`, `components`, and `layouts` directories, and start fresh.
Expand Down Expand Up @@ -50,11 +51,17 @@ const schedule = [
],
},
];

const questions = [
{ question: 'Pregunta?', answer: 'Respuesta meticulosamente pensada ' },
{ question: 'Pregunta?', answer: 'Respuesta meticulosamente pensada ' },
];
---

<Layout>
<Hero />
<Sponsors id="sponsors" sponsors={sponsors} />
<AboutUs />
<Schedule id="schedule" schedule={schedule} />
<Questions id="questions" questions={questions} />
</Layout>