Merged in fix/accordion (pull request #1318)

Fix/accordion

* fix(SW-1621): show all children in accordion

* fix(SW-1621): change FAQ label


Approved-by: Erik Tiekstra
This commit is contained in:
Matilda Landström
2025-02-13 08:24:05 +00:00
parent 599c11ba37
commit 41cb32dd30
7 changed files with 10 additions and 22 deletions

View File

@@ -14,6 +14,7 @@ import styles from "./accordion.module.css"
import type { AccordionProps } from "@/types/components/blocks/Accordion" import type { AccordionProps } from "@/types/components/blocks/Accordion"
import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation" import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
import type { RTENode } from "@/types/transitionTypes/rte/node"
export default function AccordionSection({ accordion, title }: AccordionProps) { export default function AccordionSection({ accordion, title }: AccordionProps) {
const intl = useIntl() const intl = useIntl()
@@ -36,10 +37,15 @@ export default function AccordionSection({ accordion, title }: AccordionProps) {
> >
{accordion.map((acc) => ( {accordion.map((acc) => (
<AccordionItem key={acc.question} title={acc.question}> <AccordionItem key={acc.question} title={acc.question}>
<JsonToHtml {acc.answer.json.children.map(
embeds={acc.answer.embedded_itemsConnection.edges} (child: { children: RTENode[] }, idx: number) => (
nodes={acc.answer.json?.children[0].children} <JsonToHtml
/> key={acc.question + idx}
embeds={acc.answer.embedded_itemsConnection.edges}
nodes={child.children}
/>
)
)}
</AccordionItem> </AccordionItem>
))} ))}
</Accordion> </Accordion>
@@ -48,12 +54,6 @@ export default function AccordionSection({ accordion, title }: AccordionProps) {
<ShowMoreButton <ShowMoreButton
loadMoreData={toggleAccordions} loadMoreData={toggleAccordions}
showLess={allAccordionsVisible} showLess={allAccordionsVisible}
textShowMore={intl.formatMessage({
id: "See all FAQ",
})}
textShowLess={intl.formatMessage({
id: "See less FAQ",
})}
/> />
) : null} ) : null}
</SectionContainer> </SectionContainer>

View File

@@ -485,13 +485,11 @@
"Scandic Friends Mastercard": "Scandic Friends Mastercard", "Scandic Friends Mastercard": "Scandic Friends Mastercard",
"Scandic Friends Point Shop": "Scandic Friends Point Shop", "Scandic Friends Point Shop": "Scandic Friends Point Shop",
"Search": "Søge", "Search": "Søge",
"See all FAQ": "Se alle FAQ",
"See all photos": "Se alle billeder", "See all photos": "Se alle billeder",
"See alternative hotels": "See alternative hotels", "See alternative hotels": "See alternative hotels",
"See destination": "Se destination", "See destination": "Se destination",
"See details": "Se detaljer", "See details": "Se detaljer",
"See hotel details": "Se hoteloplysninger", "See hotel details": "Se hoteloplysninger",
"See less FAQ": "Se mindre FAQ",
"See map": "Vis kort", "See map": "Vis kort",
"See on map": "Se på kort", "See on map": "Se på kort",
"See results ({ count })": "Se resultater ({ count })", "See results ({ count })": "Se resultater ({ count })",

View File

@@ -486,13 +486,11 @@
"Scandic Friends Mastercard": "Scandic Friends Mastercard", "Scandic Friends Mastercard": "Scandic Friends Mastercard",
"Scandic Friends Point Shop": "Scandic Friends Point Shop", "Scandic Friends Point Shop": "Scandic Friends Point Shop",
"Search": "Suchen", "Search": "Suchen",
"See all FAQ": "Siehe alle FAQ",
"See all photos": "Alle Fotos ansehen", "See all photos": "Alle Fotos ansehen",
"See alternative hotels": "See alternative hotels", "See alternative hotels": "See alternative hotels",
"See destination": "Siehe Ziel", "See destination": "Siehe Ziel",
"See details": "Siehe Einzelheiten", "See details": "Siehe Einzelheiten",
"See hotel details": "Hotelinformationen ansehen", "See hotel details": "Hotelinformationen ansehen",
"See less FAQ": "Weniger anzeigen FAQ",
"See map": "Karte anzeigen", "See map": "Karte anzeigen",
"See on map": "Karte ansehen", "See on map": "Karte ansehen",
"See results ({ count })": "Ergebnisse anzeigen ({ count })", "See results ({ count })": "Ergebnisse anzeigen ({ count })",

View File

@@ -491,13 +491,11 @@
"Scandic Friends Mastercard": "Scandic Friends Mastercard", "Scandic Friends Mastercard": "Scandic Friends Mastercard",
"Scandic Friends Point Shop": "Scandic Friends Point Shop", "Scandic Friends Point Shop": "Scandic Friends Point Shop",
"Search": "Search", "Search": "Search",
"See all FAQ": "See all FAQ",
"See all photos": "See all photos", "See all photos": "See all photos",
"See alternative hotels": "See alternative hotels", "See alternative hotels": "See alternative hotels",
"See destination": "See destination", "See destination": "See destination",
"See details": "See details", "See details": "See details",
"See hotel details": "See hotel details", "See hotel details": "See hotel details",
"See less FAQ": "See less FAQ",
"See map": "See map", "See map": "See map",
"See on map": "See on map", "See on map": "See on map",
"See results ({ count })": "See results ({ count })", "See results ({ count })": "See results ({ count })",

View File

@@ -486,13 +486,11 @@
"Scandic Friends Mastercard": "Scandic Friends Mastercard", "Scandic Friends Mastercard": "Scandic Friends Mastercard",
"Scandic Friends Point Shop": "Scandic Friends Point Shop", "Scandic Friends Point Shop": "Scandic Friends Point Shop",
"Search": "Haku", "Search": "Haku",
"See all FAQ": "Katso kaikki UKK",
"See all photos": "Katso kaikki kuvat", "See all photos": "Katso kaikki kuvat",
"See alternative hotels": "See alternative hotels", "See alternative hotels": "See alternative hotels",
"See destination": "Katso kohde", "See destination": "Katso kohde",
"See details": "Katso tiedot", "See details": "Katso tiedot",
"See hotel details": "Katso hotellin tiedot", "See hotel details": "Katso hotellin tiedot",
"See less FAQ": "Katso vähemmän UKK",
"See map": "Näytä kartta", "See map": "Näytä kartta",
"See on map": "Näytä kartalla", "See on map": "Näytä kartalla",
"See results ({ count })": "Katso tulokset ({ count })", "See results ({ count })": "Katso tulokset ({ count })",

View File

@@ -484,13 +484,11 @@
"Scandic Friends Mastercard": "Scandic Friends Mastercard", "Scandic Friends Mastercard": "Scandic Friends Mastercard",
"Scandic Friends Point Shop": "Scandic Friends Point Shop", "Scandic Friends Point Shop": "Scandic Friends Point Shop",
"Search": "Søk", "Search": "Søk",
"See all FAQ": "Se alle FAQ",
"See all photos": "Se alle bilder", "See all photos": "Se alle bilder",
"See alternative hotels": "See alternative hotels", "See alternative hotels": "See alternative hotels",
"See destination": "Se destinasjon", "See destination": "Se destinasjon",
"See details": "Se detaljer", "See details": "Se detaljer",
"See hotel details": "Se hotellinformasjon", "See hotel details": "Se hotellinformasjon",
"See less FAQ": "Se mindre FAQ",
"See map": "Vis kart", "See map": "Vis kart",
"See on map": "Se på kart", "See on map": "Se på kart",
"See results ({ count })": "Se resultater ({ count })", "See results ({ count })": "Se resultater ({ count })",

View File

@@ -484,13 +484,11 @@
"Scandic Friends Mastercard": "Scandic Friends Mastercard", "Scandic Friends Mastercard": "Scandic Friends Mastercard",
"Scandic Friends Point Shop": "Scandic Friends Point Shop", "Scandic Friends Point Shop": "Scandic Friends Point Shop",
"Search": "Sök", "Search": "Sök",
"See all FAQ": "Se alla FAQ",
"See all photos": "Se alla foton", "See all photos": "Se alla foton",
"See alternative hotels": "See alternative hotels", "See alternative hotels": "See alternative hotels",
"See destination": "Se destination", "See destination": "Se destination",
"See details": "Se detaljer", "See details": "Se detaljer",
"See hotel details": "Se hotellinformation", "See hotel details": "Se hotellinformation",
"See less FAQ": "See färre FAQ",
"See map": "Visa karta", "See map": "Visa karta",
"See on map": "Se på karta", "See on map": "Se på karta",
"See results ({ count })": "Se resultat ({ count })", "See results ({ count })": "Se resultat ({ count })",