fix(BOOK-405): Pushing to history when opening sidepeek to avoid navigating back inside the booking flow
Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
+12
-4
@@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { DialogTrigger } from "react-aria-components"
|
||||
import { useState } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { Button } from "@scandic-hotels/design-system/Button"
|
||||
@@ -22,15 +22,23 @@ export default function ExpiringPointsSeeAllButton({
|
||||
expiryDate,
|
||||
}: ExpiringPointsSeeAllButtonProps) {
|
||||
const intl = useIntl()
|
||||
const [isOpen, setIsOpen] = useState(false)
|
||||
|
||||
return (
|
||||
<DialogTrigger>
|
||||
<Button variant="Text" size="Medium" typography="Body/Paragraph/mdBold">
|
||||
<>
|
||||
<Button
|
||||
variant="Text"
|
||||
size="Medium"
|
||||
typography="Body/Paragraph/mdBold"
|
||||
onPress={() => setIsOpen(true)}
|
||||
>
|
||||
{intl.formatMessage({ defaultMessage: "See all" })}
|
||||
<MaterialIcon icon="chevron_right" color="CurrentColor" />
|
||||
</Button>
|
||||
<SidePeekSelfControlled
|
||||
title={intl.formatMessage({ defaultMessage: "Expiring Points" })}
|
||||
isOpen={isOpen}
|
||||
onClose={() => setIsOpen(false)}
|
||||
>
|
||||
<div className={styles.sidePeekContent}>
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
@@ -48,6 +56,6 @@ export default function ExpiringPointsSeeAllButton({
|
||||
/>
|
||||
</div>
|
||||
</SidePeekSelfControlled>
|
||||
</DialogTrigger>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user