refactor(SW-194): move css to parent

This commit is contained in:
Matilda Landström
2024-10-16 13:17:26 +02:00
parent 7f8a8e27a9
commit fa142cbbdb
4 changed files with 14 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
.accordion :not(.allVisible):nth-child(n + 6) {
.accordion:not(.allVisible) :nth-child(n + 6) {
display: none;
}
.accordion :not(.allVisible):nth-child(5) {
.accordion:not(.allVisible) :nth-child(5) {
border: none;
}

View File

@@ -25,13 +25,13 @@ export default function AccordionSection({ accordion, title }: AccordionProps) {
return (
<SectionContainer id={HotelHashValues.faq}>
{title && <SectionHeader textTransform="uppercase" title={title} />}
<Accordion className={styles.accordion} theme="light" variant="card">
<Accordion
className={`${styles.accordion}${allAccordionsVisible ? styles.allVisible : ""}`}
theme="light"
variant="card"
>
{accordion.map((acc) => (
<AccordionItem
key={acc.question}
title={acc.question}
className={`${allAccordionsVisible ? styles.allVisible : ""}`}
>
<AccordionItem key={acc.question} title={acc.question}>
<JsonToHtml
embeds={acc.answer.embedded_itemsConnection.edges}
nodes={acc.answer.json?.children[0].children}

View File

@@ -17,7 +17,7 @@ import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
export function Rooms({ rooms }: RoomsProps) {
const intl = useIntl()
const showToggleButton = rooms.length > 6
const showToggleButton = rooms.length > 4
const [allRoomsVisible, setAllRoomsVisible] = useState(!showToggleButton)
const scrollRef = useRef<HTMLDivElement>(null)
@@ -61,12 +61,11 @@ export function Rooms({ rooms }: RoomsProps) {
title={intl.formatMessage({ id: "Rooms" })}
preamble={null}
/>
<Grids.Stackable className={styles.grid}>
<Grids.Stackable
className={`${styles.grid}${allRoomsVisible ? styles.allVisible : ""}`}
>
{mappedRooms.map(({ id, images, title, subtitle, popularChoice }) => (
<div
key={id}
className={`${allRoomsVisible ? styles.allVisible : ""}`}
>
<div key={id}>
<RoomCard
id={id}
images={images}

View File

@@ -17,6 +17,6 @@
transform: rotate(180deg);
}
.grid :not(.allVisible):nth-child(n + 4) {
.grid:not(.allVisible) :nth-child(n + 4) {
display: none;
}