Skip to content

Commit 8d26428

Browse files
committed
fix: rename tooltip component and add classname property
1 parent cea18e4 commit 8d26428

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/packages/tooltip/tooltipContent.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ const { div } = dom.tags;
55
export type tooltipContentProps = {
66
text: string;
77
tooltipRenderAsHtml?: boolean;
8+
className?: string;
89
};
910

10-
export const tooltipContetnt = ({ text, tooltipRenderAsHtml }: tooltipContentProps) => {
11-
const container = div({});
11+
export const TooltipContent = ({ text, tooltipRenderAsHtml, className }: tooltipContentProps) => {
12+
const container = div({
13+
className: className || "introjs-tooltiptext",
14+
});
1215

1316
dom.derive(() => {
1417
const el = container as HTMLElement;

src/packages/tour/components/TourTooltip.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { TourStep } from "../steps";
2323
import { dataStepNumberAttribute } from "../dataAttributes";
2424
import scrollParentToElement from "../../../util/scrollParentToElement";
2525
import scrollTo from "../../../util/scrollTo";
26-
import { tooltipContetnt } from "../../tooltip/tooltipContent";
26+
import { TooltipContent } from "../../tooltip/tooltipContent";
2727

2828
const { h1, div, input, label, ul, li, a } = dom.tags;
2929

@@ -453,13 +453,11 @@ export const TourTooltip = ({
453453
children.push(Header({ title, skipLabel, onSkipClick }));
454454

455455
children.push(
456-
div(
457-
{ className: tooltipTextClassName },
458-
tooltipContetnt({
456+
TooltipContent({
459457
text,
460458
tooltipRenderAsHtml: props.renderAsHtml,
459+
className: tooltipTextClassName,
461460
})
462-
)
463461
);
464462

465463
if (dontShowAgain) {

0 commit comments

Comments
 (0)