feat(SW-391): Added sidepeek functionality to teasercard

This commit is contained in:
Erik Tiekstra
2024-10-10 08:13:50 +02:00
parent a5d9eb43c9
commit 9620071c78
21 changed files with 311 additions and 69 deletions

View File

@@ -10,7 +10,7 @@ import {
} from "react-aria-components"
import { useIntl } from "react-intl"
import { CloseIcon } from "@/components/Icons"
import { CloseLargeIcon } from "@/components/Icons"
import { SidePeekContext } from "@/components/SidePeekProvider"
import Button from "../Button"
@@ -52,13 +52,16 @@ function SidePeek({
</div>
)
}
return (
<div ref={setRef}>
<DialogTrigger>
<ModalOverlay
UNSTABLE_portalContainer={rootDiv}
className={styles.overlay}
isOpen={isOpen || contentKey === context?.activeSidePeek}
isOpen={
isOpen || (!!contentKey && contentKey === context?.activeSidePeek)
}
onOpenChange={onClose}
isDismissable
>
@@ -80,9 +83,9 @@ function SidePeek({
aria-label={intl.formatMessage({ id: "Close" })}
className={styles.closeButton}
intent="text"
onPress={onClose}
onClick={onClose}
>
<CloseIcon color="burgundy" height={32} width={32} />
<CloseLargeIcon color="burgundy" />
</Button>
</header>
<div className={styles.sidePeekContent}>{children}</div>