Skip to content

Commit

Permalink
improve faq
Browse files Browse the repository at this point in the history
  • Loading branch information
guitavano committed Apr 17, 2024
1 parent ffea419 commit 3520dd7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 65 deletions.
8 changes: 2 additions & 6 deletions components/ui/CookieConsent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,8 @@ function CookieConsent(props: Props) {
id={id}
class="transform-gpu translate-y-[200%] transition fixed bottom-0 lg:bottom-2 w-screen z-50 lg:flex lg:justify-center"
>
<div
class="p-4 mx-4 my-2 flex flex-col gap-4 shadow bg-base-100 rounded border border-base-200 lg:w-[520px] lg:flex-row lg:items-end"
>
<div
class="flex-auto flex flex-col gap-4 lg:gap-2"
>
<div class="p-4 mx-4 my-2 flex flex-col gap-4 shadow bg-base-100 rounded border border-base-200 lg:w-[520px] lg:flex-row lg:items-end">
<div class="flex-auto flex flex-col gap-4 lg:gap-2">
<h3 class="text-xl">{title}</h3>
{text && (
<div
Expand Down
71 changes: 12 additions & 59 deletions sections/Content/Faq.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ export interface Props {
description?: string;
questions?: Question[];
contact?: Contact;
layout?: {
variation?: "Compact" | "Full" | "Side to side";
};
}

const DEFAULT_PROPS = {
Expand Down Expand Up @@ -87,67 +84,23 @@ export default function FAQ(props: Props) {
title,
description,
contact,
layout,
} = { ...DEFAULT_PROPS, ...props };

return (
<>
{(!layout?.variation || layout?.variation === "Compact") && (
<div class="w-full container px-4 py-8 flex flex-col gap-4 lg:gap-8 lg:py-10 lg:px-40">
<div class="flex flex-col gap-8 lg:gap-10">
<div class="flex flex-col gap-2">
<h2 class="text-base-content text-center text-3xl font-semibold">
{title}
</h2>
<p class="text-center">{description}</p>
</div>
<div class="join join-vertical w-full">
{questions.map((question) => <Question {...question} />)}
</div>
</div>

<Contact {...contact} />
<div class="w-full container px-4 py-8 flex flex-col gap-4 lg:gap-8 lg:py-10 lg:px-40">
<div class="flex flex-col gap-8 lg:gap-10">
<div class="flex flex-col gap-2">
<h2 class="text-base-content text-center text-3xl font-semibold">
{title}
</h2>
<p class="text-center">{description}</p>
</div>
)}

{layout?.variation === "Full" && (
<div class="w-full container px-4 py-8 flex flex-col gap-4 lg:gap-8 lg:py-10 lg:px-0">
<div class="flex flex-col gap-8 lg:gap-10">
<div class="flex flex-col gap-2">
<h2 class="text-base-content text-center text-3xl font-semibold">
{title}
</h2>
<p class="text-center">{description}</p>
</div>
<div class="join join-vertical w-full">
{questions.map((question) => <Question {...question} />)}
</div>
</div>

<Contact {...contact} />
<div class="join join-vertical w-full">
{questions.map((question) => <Question {...question} />)}
</div>
)}
</div>

{layout?.variation === "Side to side" && (
<div class="w-full container px-4 py-8 grid gap-8 grid-flow-row grid-cols-1 lg:grid-flow-col lg:grid-cols-2 lg:grid-rows-2 lg:py-10 lg:px-0">
<div class="order-1 lg:order-1">
<div class="flex flex-col gap-2">
<h2 class="text-base-content text-center text-3xl font-semibold">
{title}
</h2>
<p class="text-center">{description}</p>
</div>
</div>
<div class="order-2 lg:order-3 lg:row-span-2">
<div class="join join-vertical">
{questions.map((question) => <Question {...question} />)}
</div>
</div>
<div class="order-3 lg:order-2">
<Contact {...contact} />
</div>
</div>
)}
</>
<Contact {...contact} />
</div>
);
}

0 comments on commit 3520dd7

Please sign in to comment.