fix(SW-194): cleanup
This commit is contained in:
@@ -18,7 +18,6 @@ export default function AccordionSection({ accordion, title }: AccordionProps) {
|
||||
function handleToggleShowMore() {
|
||||
setAllItemsVisible((previousState) => !previousState)
|
||||
}
|
||||
console.log("PUP", accordion)
|
||||
|
||||
function getClassName(idx: number): string {
|
||||
if (!allItemsVisible && idx > 4) {
|
||||
@@ -28,20 +27,21 @@ export default function AccordionSection({ accordion, title }: AccordionProps) {
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
return (
|
||||
<SectionContainer id="faq">
|
||||
{title && <SectionHeader textTransform="uppercase" title={title} />}
|
||||
<Accordion theme={"light"} variant={"card"}>
|
||||
{accordion.map((acc, idx) => (
|
||||
{accordion.map((acc, idx: number) => (
|
||||
<AccordionItem
|
||||
key={acc.question + idx}
|
||||
title={acc.question}
|
||||
className={getClassName(idx)}
|
||||
>
|
||||
{/*<JsonToHtml
|
||||
<JsonToHtml
|
||||
embeds={acc.answer.embedded_itemsConnection.edges}
|
||||
nodes={acc.answer.json?.children}
|
||||
/>*/}
|
||||
nodes={acc.answer.json?.children[0].children}
|
||||
/>
|
||||
</AccordionItem>
|
||||
))}
|
||||
</Accordion>
|
||||
|
||||
@@ -83,6 +83,10 @@ query GetContentPageRefs($locale: String!, $uid: String!) {
|
||||
__typename
|
||||
...Accordion_ContentPageRefs
|
||||
...CardsGrid_ContentPageRefs
|
||||
...Content_ContentPageRefs
|
||||
...DynamicContent_ContentPageRefs
|
||||
...Shortcuts_ContentPageRefs
|
||||
...TextCols_ContentPageRef
|
||||
...UspGrid_ContentPageRefs
|
||||
}
|
||||
sidebar {
|
||||
|
||||
@@ -6,6 +6,7 @@ import { BlocksEnums } from "@/types/enums/blocks"
|
||||
|
||||
export const faqSchema = z.array(
|
||||
z.object({
|
||||
question: z.string(),
|
||||
answer: z.object({
|
||||
json: z.any(),
|
||||
embedded_itemsConnection: z.object({
|
||||
@@ -28,7 +29,6 @@ export const faqSchema = z.array(
|
||||
),
|
||||
}),
|
||||
}),
|
||||
question: z.string(),
|
||||
})
|
||||
)
|
||||
|
||||
@@ -93,10 +93,6 @@ export const accordionSchema = z.object({
|
||||
}),
|
||||
}
|
||||
}),
|
||||
|
||||
/*hotel_specific_faq: z.object({
|
||||
questions: faqSchema,
|
||||
}),*/
|
||||
})
|
||||
|
||||
const actualRefs = z.discriminatedUnion("__typename", [
|
||||
|
||||
Reference in New Issue
Block a user