fix(SW-194): update css on Rooms

This commit is contained in:
Matilda Landström
2024-10-16 11:01:41 +02:00
parent e52391f120
commit 7f8a8e27a9
2 changed files with 19 additions and 23 deletions

View File

@@ -61,14 +61,11 @@ export function Rooms({ rooms }: RoomsProps) {
title={intl.formatMessage({ id: "Rooms" })} title={intl.formatMessage({ id: "Rooms" })}
preamble={null} preamble={null}
/> />
<Grids.Stackable> <Grids.Stackable className={styles.grid}>
{mappedRooms.map( {mappedRooms.map(({ id, images, title, subtitle, popularChoice }) => (
({ id, images, title, subtitle, popularChoice }, index) => (
<div <div
key={id} key={id}
className={ className={`${allRoomsVisible ? styles.allVisible : ""}`}
!allRoomsVisible && index > 2 ? styles.hiddenRoomCard : ""
}
> >
<RoomCard <RoomCard
id={id} id={id}
@@ -78,8 +75,7 @@ export function Rooms({ rooms }: RoomsProps) {
badgeTextTransKey={popularChoice ? "Popular choice" : null} badgeTextTransKey={popularChoice ? "Popular choice" : null}
/> />
</div> </div>
) ))}
)}
</Grids.Stackable> </Grids.Stackable>
{showToggleButton ? ( {showToggleButton ? (

View File

@@ -13,10 +13,10 @@
justify-content: center; justify-content: center;
} }
.hiddenRoomCard {
display: none;
}
.showMoreButton.showLess .chevron { .showMoreButton.showLess .chevron {
transform: rotate(180deg); transform: rotate(180deg);
} }
.grid :not(.allVisible):nth-child(n + 4) {
display: none;
}