Merged in fix/SW-1330-filter-tooltip-mobile (pull request #1146)
fix(SW-1330): add space and fix touchable tooltip for ipad * fix(SW-1330): add space and fix touchable tooltip for ipad Approved-by: Pontus Dreij Approved-by: Niclas Edenvin
This commit is contained in:
@@ -65,9 +65,6 @@ export default function RoomFilter({
|
|||||||
const tooltipText = intl.formatMessage({
|
const tooltipText = intl.formatMessage({
|
||||||
id: "Pet-friendly rooms have an additional fee of 20 EUR per stay",
|
id: "Pet-friendly rooms have an additional fee of 20 EUR per stay",
|
||||||
})
|
})
|
||||||
|
|
||||||
const showTooltip = isAboveMobile && petFriendly
|
|
||||||
|
|
||||||
const submitFilter = useCallback(() => {
|
const submitFilter = useCallback(() => {
|
||||||
const data = getValues()
|
const data = getValues()
|
||||||
onFilter(data)
|
onFilter(data)
|
||||||
@@ -94,19 +91,14 @@ export default function RoomFilter({
|
|||||||
</div>
|
</div>
|
||||||
<div className={styles.infoMobile}>
|
<div className={styles.infoMobile}>
|
||||||
<div className={styles.filterInfo}>
|
<div className={styles.filterInfo}>
|
||||||
{!isAboveMobile ? (
|
<Tooltip
|
||||||
<Tooltip
|
text={tooltipText}
|
||||||
text={tooltipText}
|
position="bottom"
|
||||||
position="bottom"
|
arrow="left"
|
||||||
arrow="left"
|
isTouchable
|
||||||
isTouchable
|
>
|
||||||
>
|
<InfoCircleIcon color="uiTextHighContrast" height={20} width={20} />
|
||||||
<InfoCircleIcon
|
<div className={styles.filter}>
|
||||||
color="uiTextHighContrast"
|
|
||||||
height={20}
|
|
||||||
width={20}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Caption
|
<Caption
|
||||||
type="label"
|
type="label"
|
||||||
color="baseTextMediumContrast"
|
color="baseTextMediumContrast"
|
||||||
@@ -114,30 +106,14 @@ export default function RoomFilter({
|
|||||||
>
|
>
|
||||||
{intl.formatMessage({ id: "Filter" })}
|
{intl.formatMessage({ id: "Filter" })}
|
||||||
</Caption>
|
</Caption>
|
||||||
<Caption type="label" color="baseTextMediumContrast">
|
<Caption type="regular" color="baseTextMediumContrast">
|
||||||
{Object.entries(selectedFilters)
|
{Object.entries(selectedFilters)
|
||||||
.filter(([_, value]) => value)
|
.filter(([_, value]) => value)
|
||||||
.map(([key]) => intl.formatMessage({ id: key }))
|
.map(([key]) => intl.formatMessage({ id: key }))
|
||||||
.join(", ")}
|
.join(", ")}
|
||||||
</Caption>
|
</Caption>
|
||||||
</Tooltip>
|
</div>
|
||||||
) : (
|
</Tooltip>
|
||||||
<>
|
|
||||||
<Caption
|
|
||||||
type="label"
|
|
||||||
color="baseTextMediumContrast"
|
|
||||||
textTransform="uppercase"
|
|
||||||
>
|
|
||||||
{intl.formatMessage({ id: "Filter" })}
|
|
||||||
</Caption>
|
|
||||||
<Caption type="label" color="baseTextMediumContrast">
|
|
||||||
{Object.entries(selectedFilters)
|
|
||||||
.filter(([_, value]) => value)
|
|
||||||
.map(([key]) => intl.formatMessage({ id: key }))
|
|
||||||
.join(", ")}
|
|
||||||
</Caption>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<Caption color="uiTextHighContrast">
|
<Caption color="uiTextHighContrast">
|
||||||
{intl.formatMessage(
|
{intl.formatMessage(
|
||||||
@@ -170,12 +146,13 @@ export default function RoomFilter({
|
|||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
||||||
return showTooltip ? (
|
return isPetRoom && isAboveMobile ? (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
key={option.code}
|
key={option.code}
|
||||||
text={tooltipText}
|
text={tooltipText}
|
||||||
position="bottom"
|
position="bottom"
|
||||||
arrow="right"
|
arrow="right"
|
||||||
|
isTouchable
|
||||||
>
|
>
|
||||||
{checkboxChip}
|
{checkboxChip}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@@ -12,6 +12,13 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.filter {
|
||||||
|
display: flex;
|
||||||
|
gap: var(--Spacing-x-half);
|
||||||
|
margin-left: var(--Spacing-x-half);
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
.filterInfo {
|
.filterInfo {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
Reference in New Issue
Block a user