Fix tooltip bugs

This commit is contained in:
Josh Perez 2020-11-19 13:11:35 -05:00 committed by Josh Perez
parent 6398a01852
commit c6eafbb8d5
16 changed files with 339 additions and 235 deletions

View file

@ -3,15 +3,11 @@
import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { number, select } from '@storybook/addon-knobs';
import { select } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import {
CallingButton,
CallingButtonType,
PropsType,
TooltipDirection,
} from './CallingButton';
import { CallingButton, CallingButtonType, PropsType } from './CallingButton';
import { TooltipPlacement } from './Tooltip';
import { setup as setupI18n } from '../../js/modules/i18n';
import enMessages from '../../_locales/en/messages.json';
@ -27,12 +23,8 @@ const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
onClick: action('on-click'),
tooltipDirection: select(
'tooltipDirection',
TooltipDirection,
overrideProps.tooltipDirection || TooltipDirection.DOWN
),
tooltipDistance: number(
'tooltipDistance',
overrideProps.tooltipDistance || 16
TooltipPlacement,
overrideProps.tooltipDirection || TooltipPlacement.Bottom
),
});
@ -87,7 +79,7 @@ story.add('Video Disabled', () => {
story.add('Tooltip right', () => {
const props = createProps({
tooltipDirection: TooltipDirection.RIGHT,
tooltipDirection: TooltipPlacement.Right,
});
return <CallingButton {...props} />;
});