blob: ff5f0bab6b8274cf8afd3e3bc6c8d1801a331003 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import * as React from 'react';
import { OnboardingCard, OnboardingCardProps } from 'ts/components/onboarding/onboarding_card';
import { Pointer, PointerDirection } from 'ts/components/ui/pointer';
export type ContinueButtonDisplay = 'enabled' | 'disabled';
export type TooltipPointerDisplay = PointerDirection | 'none';
export interface OnboardingTooltipProps extends OnboardingCardProps {
className?: string;
pointerDisplay?: TooltipPointerDisplay;
}
export const OnboardingTooltip: React.StatelessComponent<OnboardingTooltipProps> = props => {
const { pointerDisplay, className, ...cardProps } = props;
const card = <OnboardingCard {...cardProps} />;
if (pointerDisplay === 'none') {
return card;
}
return (
<Pointer className={className} direction={pointerDisplay}>
<OnboardingCard {...cardProps} />
</Pointer>
);
};
OnboardingTooltip.defaultProps = {
pointerDisplay: PointerDirection.Left,
};
OnboardingTooltip.displayName = 'OnboardingTooltip';
|