fix(SW-1111) added position for backToTopButton
This commit is contained in:
@@ -103,12 +103,14 @@ export default function HotelCardDialog({
|
||||
<Caption type="bold">
|
||||
{intl.formatMessage({ id: "From" })}
|
||||
</Caption>
|
||||
<Subtitle type="two">
|
||||
{publicPrice} {currency}
|
||||
<Body asChild>
|
||||
<span>/{intl.formatMessage({ id: "night" })}</span>
|
||||
</Body>
|
||||
</Subtitle>
|
||||
{publicPrice && (
|
||||
<Subtitle type="two">
|
||||
{publicPrice} {currency}
|
||||
<Body asChild>
|
||||
<span>/{intl.formatMessage({ id: "night" })}</span>
|
||||
</Body>
|
||||
</Subtitle>
|
||||
)}
|
||||
{memberPrice && (
|
||||
<Subtitle
|
||||
type="two"
|
||||
|
||||
@@ -128,7 +128,9 @@ export default function HotelCardListing({
|
||||
text={intl.formatMessage({ id: "filters.nohotel.text" })}
|
||||
/>
|
||||
) : null}
|
||||
{showBackToTop && <BackToTopButton onClick={scrollToTop} />}
|
||||
{showBackToTop && (
|
||||
<BackToTopButton position="right" onClick={scrollToTop} />
|
||||
)}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -125,7 +125,9 @@ export default function SelectHotelMap({
|
||||
activeHotelPin={activeHotelPin}
|
||||
setActiveHotelPin={setActiveHotelPin}
|
||||
/>
|
||||
{showBackToTop && <BackToTopButton onClick={scrollToTop} />}
|
||||
{showBackToTop && (
|
||||
<BackToTopButton position="right" onClick={scrollToTop} />
|
||||
)}
|
||||
</div>
|
||||
<InteractiveMap
|
||||
closeButton={closeButton}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
align-items: flex-end;
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
z-index: 1000;
|
||||
background-color: var(--Base-Surface-Primary-light-Normal);
|
||||
color: var(--Base-Button-Secondary-On-Fill-Normal);
|
||||
@@ -28,6 +27,14 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.left {
|
||||
left: 32px;
|
||||
}
|
||||
|
||||
.right {
|
||||
right: 32px;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.backToTopButtonText {
|
||||
display: initial;
|
||||
|
||||
@@ -5,12 +5,23 @@ import { useIntl } from "react-intl"
|
||||
|
||||
import { ArrowUpIcon } from "@/components/Icons"
|
||||
|
||||
import { backToTopButtonVariants } from "./variants"
|
||||
|
||||
import styles from "./backToTopButton.module.css"
|
||||
|
||||
export function BackToTopButton({ onClick }: { onClick: () => void }) {
|
||||
export function BackToTopButton({
|
||||
onClick,
|
||||
position,
|
||||
}: {
|
||||
onClick: () => void
|
||||
position: "left" | "right"
|
||||
}) {
|
||||
const intl = useIntl()
|
||||
return (
|
||||
<ButtonRAC className={styles.backToTopButton} onPress={onClick}>
|
||||
<ButtonRAC
|
||||
className={backToTopButtonVariants({ position })}
|
||||
onPress={onClick}
|
||||
>
|
||||
<ArrowUpIcon color="burgundy" />
|
||||
<span className={styles.backToTopButtonText}>
|
||||
{intl.formatMessage({ id: "Back to top" })}
|
||||
|
||||
15
components/TempDesignSystem/BackToTopButton/variants.ts
Normal file
15
components/TempDesignSystem/BackToTopButton/variants.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import styles from "./backToTopButton.module.css"
|
||||
|
||||
export const backToTopButtonVariants = cva(styles.backToTopButton, {
|
||||
variants: {
|
||||
position: {
|
||||
left: styles.left,
|
||||
right: styles.right,
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
position: "right",
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user