-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
718c4fd
commit 9e73d8e
Showing
7 changed files
with
120 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import van from "../dom/van"; | ||
import { tooltipReferenceLayerClassName } from "./classNames"; | ||
import { setPositionRelativeToStep } from "./position"; | ||
import { TourStep } from "./steps"; | ||
import { TourTooltip, TourTooltipProps } from "./tourTooltip"; | ||
|
||
const { div } = van.tags; | ||
|
||
export type ReferenceLayerProps = TourTooltipProps & { | ||
step: TourStep; | ||
targetElement: HTMLElement; | ||
helperElementPadding: number; | ||
}; | ||
|
||
export const ReferenceLayer = ({ | ||
step, | ||
targetElement, | ||
helperElementPadding, | ||
...props | ||
}: ReferenceLayerProps) => { | ||
const referenceLayer = div( | ||
{ | ||
className: tooltipReferenceLayerClassName, | ||
}, | ||
TourTooltip(props) | ||
); | ||
|
||
setPositionRelativeToStep( | ||
targetElement, | ||
referenceLayer, | ||
step, | ||
helperElementPadding | ||
); | ||
|
||
return referenceLayer; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters