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