Skip to content

Commit

Permalink
FIX some bs
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed May 17, 2019
1 parent 92c6659 commit 6d90164
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 36 deletions.
2 changes: 2 additions & 0 deletions examples/cra-ts-kitchen-sink/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": { "*": ["types/*"] },
"target": "es5",
"module": "esnext",
"lib" : ["esnext", "dom"],
Expand Down
8 changes: 8 additions & 0 deletions examples/cra-ts-kitchen-sink/types/@storybook/react.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const addDecorator: any;
export const addParameters: any;
export const configure: any;
export const forceReRender: any;
export const getStorybook: any;
export const raw: any;
export const setAddon: any;
export const storiesOf: any;
34 changes: 0 additions & 34 deletions lib/components/src/StoryLinkWrapper.ts

This file was deleted.

33 changes: 31 additions & 2 deletions lib/components/src/tooltip/TooltipLinkList.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
import React from 'react';
/* eslint-disable import/no-unresolved */
/* eslint-disable import/extensions */
/* eslint-disable import/no-extraneous-dependencies */
import React, { Children, FunctionComponent, ReactElement, ReactNode } from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { WithTooltip } from './WithTooltip';

import { TooltipLinkList } from './TooltipLinkList';
import StoryLinkWrapper from '../StoryLinkWrapper';

const onLinkClick = action('onLinkClick');

interface StoryLinkWrapperProps {
href: string;
passHref?: boolean;
}

const StoryLinkWrapper: FunctionComponent<StoryLinkWrapperProps> = ({
href,
passHref,
children,
}) => {
const child = Children.only(children) as ReactElement;

return React.cloneElement(child, {
href: passHref && href,
onClick: (e: React.MouseEvent) => {
e.preventDefault();
onLinkClick(href);
},
});
};

StoryLinkWrapper.defaultProps = {
passHref: false,
};

export const links = [
{ id: '1', title: 'Link', href: 'http://google.com' },
Expand Down

0 comments on commit 6d90164

Please sign in to comment.