Merged in fix/SW-2345-ui-map-close-icon-filter (pull request #2599)

fix(SW-2345): ui fixes for map etc

* fix(SW-2345): ui fixes for map etc


Approved-by: Anton Gunnarsson
This commit is contained in:
Bianca Widstam
2025-08-06 11:26:12 +00:00
parent d391076125
commit 4b3d59f75b
6 changed files with 101 additions and 71 deletions

View File

@@ -96,6 +96,8 @@
} }
.header { .header {
display: flex;
justify-content: flex-end;
text-align: right; text-align: right;
padding: var(--Spacing-x-one-and-half); padding: var(--Spacing-x-one-and-half);
flex: 0 0 auto; flex: 0 0 auto;
@@ -103,14 +105,7 @@
.title { .title {
display: none; display: none;
} text-align: center;
.close {
background: none;
border: none;
cursor: pointer;
justify-self: flex-end;
padding: 0;
} }
.divider { .divider {
@@ -143,8 +138,8 @@
.header { .header {
display: grid; display: grid;
grid-template-columns: auto 1fr; grid-template-columns: 1fr auto;
padding: var(--Spacing-x2) var(--Spacing-x3); padding: var(--Space-x1);
align-items: center; align-items: center;
border-bottom: 1px solid var(--Base-Border-Subtle); border-bottom: 1px solid var(--Base-Border-Subtle);
position: sticky; position: sticky;

View File

@@ -13,12 +13,12 @@ import {
} from "react-aria-components" } from "react-aria-components"
import { useIntl } from "react-intl" import { useIntl } from "react-intl"
import { Button } from "@scandic-hotels/design-system/Button"
import DeprecatedSelect from "@scandic-hotels/design-system/DeprecatedSelect" import DeprecatedSelect from "@scandic-hotels/design-system/DeprecatedSelect"
import { Divider } from "@scandic-hotels/design-system/Divider" import { Divider } from "@scandic-hotels/design-system/Divider"
import Footnote from "@scandic-hotels/design-system/Footnote" import { IconButton } from "@scandic-hotels/design-system/IconButton"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton" import { Typography } from "@scandic-hotels/design-system/Typography"
import Subtitle from "@scandic-hotels/design-system/Subtitle"
import { useHotelFilterStore } from "@/stores/hotel-filters" import { useHotelFilterStore } from "@/stores/hotel-filters"
@@ -134,13 +134,19 @@ export default function FilterAndSortModal({
return ( return (
<> <>
<DialogTrigger> <DialogTrigger>
<Button intent="secondary" size="small" theme="base" variant="icon"> <Button variant="Secondary" size="Small" color="Primary">
<MaterialIcon icon="filter_alt" color="Icon/Intense" /> <MaterialIcon icon="filter_alt" color="CurrentColor" />
{intl.formatMessage({ <Typography variant="Body/Supporting text (caption)/smBold">
defaultMessage: "Filter and sort", <p>
})} {intl.formatMessage({
defaultMessage: "Filter and sort",
})}
</p>
</Typography>
{activeFilters.length > 0 && ( {activeFilters.length > 0 && (
<Footnote className={styles.badge}>{activeFilters.length}</Footnote> <Typography variant="Label/xsRegular" className={styles.badge}>
<p>{activeFilters.length}</p>
</Typography>
)} )}
</Button> </Button>
<ModalOverlay className={styles.overlay} isDismissable> <ModalOverlay className={styles.overlay} isDismissable>
@@ -149,22 +155,26 @@ export default function FilterAndSortModal({
{({ close }) => ( {({ close }) => (
<> <>
<header className={styles.header}> <header className={styles.header}>
<button <Typography
onClick={close} variant="Title/Subtitle/md"
type="button"
className={styles.close}
>
<MaterialIcon icon="close" />
</button>
<Subtitle
type="two"
textAlign="center"
className={styles.title} className={styles.title}
> >
{intl.formatMessage({ <p>
defaultMessage: "Filter and sort", {intl.formatMessage({
defaultMessage: "Filter and sort",
})}
</p>
</Typography>
<IconButton
theme="Black"
style="Muted"
onPress={close}
aria-label={intl.formatMessage({
defaultMessage: "Close",
})} })}
</Subtitle> >
<MaterialIcon icon="close" />
</IconButton>
</header> </header>
<div className={styles.sorter}> <div className={styles.sorter}>
<DeprecatedSelect <DeprecatedSelect
@@ -200,34 +210,42 @@ export default function FilterAndSortModal({
</div> </div>
<footer className={styles.footer}> <footer className={styles.footer}>
<Button <Button
intent="primary" variant="Tertiary"
size="medium" color="Primary"
theme="base" size="Large"
onClick={() => handleApplyFiltersAndSorting(close)} onClick={() => handleApplyFiltersAndSorting(close)}
> >
{intl.formatMessage( <Typography variant="Body/Paragraph/mdBold">
{ <p>
defaultMessage: "See results ({ count })", {intl.formatMessage(
}, {
{ defaultMessage: "See results ({ count })",
count: filteredCount },
? filteredCount {
: unfilteredResultCount, count: filteredCount
} ? filteredCount
)} : unfilteredResultCount,
}
)}
</p>
</Typography>
</Button> </Button>
<Button <Button
onClick={() => { onClick={() => {
setSelectedFilters([]) setSelectedFilters([])
setFilteredCount(unfilteredResultCount) setFilteredCount(unfilteredResultCount)
}} }}
intent="text" variant="Text"
size="medium" color="Primary"
theme="base" size="Medium"
> >
{intl.formatMessage({ <Typography variant="Body/Paragraph/mdBold">
defaultMessage: "Clear all filters", <p>
})} {intl.formatMessage({
defaultMessage: "Clear all filters",
})}
</p>
</Typography>
</Button> </Button>
</footer> </footer>
</> </>

View File

@@ -44,7 +44,7 @@ export default function MobileMapButtonContainer({
keepSearchParams keepSearchParams
weight="bold" weight="bold"
> >
<MaterialIcon icon="map" color="Icon/Intense" /> <MaterialIcon icon="map" color="CurrentColor" />
{intl.formatMessage({ {intl.formatMessage({
defaultMessage: "See on map", defaultMessage: "See on map",
})} })}

View File

@@ -14,8 +14,9 @@ import {
} from "@scandic-hotels/common/constants/routes/hotelReservation" } from "@scandic-hotels/common/constants/routes/hotelReservation"
import { debounce } from "@scandic-hotels/common/utils/debounce" import { debounce } from "@scandic-hotels/common/utils/debounce"
import { BackToTopButton } from "@scandic-hotels/design-system/BackToTopButton" import { BackToTopButton } from "@scandic-hotels/design-system/BackToTopButton"
import { Button } from "@scandic-hotels/design-system/Button"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton" import { Typography } from "@scandic-hotels/design-system/Typography"
import { useHotelFilterStore } from "@/stores/hotel-filters" import { useHotelFilterStore } from "@/stores/hotel-filters"
import { useHotelsMapStore } from "@/stores/hotels-map" import { useHotelsMapStore } from "@/stores/hotels-map"
@@ -137,17 +138,26 @@ export default function SelectHotelContent({
: selectHotel(lang) : selectHotel(lang)
const closeButton = ( const closeButton = (
<Button <Button
intent="inverted" variant="Primary"
size="small" color="Inverted"
theme="base" wrapping
size="Small"
className={styles.closeButton} className={styles.closeButton}
asChild
> >
<Link href={closeMapUrl} keepSearchParams prefetch> <Link
href={closeMapUrl}
keepSearchParams
prefetch
className={styles.link}
>
<MaterialIcon icon="close" size={20} color="CurrentColor" /> <MaterialIcon icon="close" size={20} color="CurrentColor" />
{intl.formatMessage({ <Typography variant="Body/Supporting text (caption)/smBold">
defaultMessage: "Close the map", <p>
})} {intl.formatMessage({
defaultMessage: "Close the map",
})}
</p>
</Typography>
</Link> </Link>
</Button> </Button>
) )
@@ -170,16 +180,20 @@ export default function SelectHotelContent({
<div className={styles.listingContainer} ref={listingContainerRef}> <div className={styles.listingContainer} ref={listingContainerRef}>
<div className={styles.filterContainer}> <div className={styles.filterContainer}>
<Button <Button
intent="text" variant="Text"
type="button" type="button"
variant="icon" size="Small"
size="small"
className={styles.filterContainerCloseButton} className={styles.filterContainerCloseButton}
asChild
> >
<Link href={closeMapUrl} keepSearchParams> <Link href={closeMapUrl} keepSearchParams className={styles.link}>
<MaterialIcon icon="arrow_back" color="CurrentColor" size={20} /> <MaterialIcon
{intl.formatMessage({ defaultMessage: "Back" })} icon="arrow_back_ios"
color="CurrentColor"
size={20}
/>
<Typography variant="Body/Supporting text (caption)/smBold">
<p>{intl.formatMessage({ defaultMessage: "Back" })}</p>
</Typography>
</Link> </Link>
</Button> </Button>
<FilterAndSortModal <FilterAndSortModal

View File

@@ -21,14 +21,17 @@
.container .listingContainer .filterContainer > button { .container .listingContainer .filterContainer > button {
border: none; border: none;
text-decoration: none;
} }
.skeletonContainer { .skeletonContainer {
display: none; display: none;
} }
.filterContainerCloseButton { .link {
color: var(--Component-Button-Brand-Secondary-On-fill-Default); display: flex;
gap: var(--Space-x05);
align-items: baseline;
} }
.bookingCodeFilter { .bookingCodeFilter {

View File

@@ -15,7 +15,7 @@
} }
.body { .body {
opacity: 0.8; color: var(--Text-Default);
} }
.hideWrapper { .hideWrapper {