Skip to content

Commit

Permalink
fix: TS warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip authored and Marc MacLeod committed Dec 28, 2018
1 parent edc36de commit 74286fa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/ScrollBox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @jsx jsx */
import { jsx } from '@emotion/core';
import { forwardRef, useRef, useState } from 'react';
import { forwardRef, FunctionComponent, RefObject, useRef, useState } from 'react';
import Scrollbars, { positionValues, ScrollbarProps } from 'react-custom-scrollbars';

import { Box, IBox } from './Box';
Expand Down Expand Up @@ -38,7 +38,7 @@ const scrollbarStyles = ({ isScrolling }: IScrollBoxThumbProps) => {
};
};

export const ScrollBox: React.FunctionComponent<IScrollBox> = (props: IScrollBox) => {
export const ScrollBox: FunctionComponent<IScrollBox> = (props: IScrollBox) => {
// pull out scrollTo so they are not in scrollbarProps (don't want them spread onto <Scrollbars /> component)
const { scrollTo, children, onUpdate, autoHeight = true, autoHideTimeout = 500, innerRef, ...scrollbarProps } = props;

Expand Down Expand Up @@ -112,7 +112,7 @@ export const ScrollBox: React.FunctionComponent<IScrollBox> = (props: IScrollBox
export interface IScrollBox extends IScrollBoxProps, ScrollbarProps {}

export interface IScrollBoxProps {
innerRef?: React.RefObject<Scrollbars>;
innerRef?: RefObject<Scrollbars>;

autoHeight?: boolean;
autoHideTimeout?: number;
Expand Down
2 changes: 1 addition & 1 deletion src/__stories__/Menus/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ storiesOf('Menus:Menu', module)
{ title: 'Disabled Item', disabled: true, icon: 'times-circle' },
]}
/>
))
));
5 changes: 3 additions & 2 deletions src/__stories__/Misc/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { StateDecorator, Store } from '@sambego/storybook-state';
import { action } from '@storybook/addon-actions';
import { object, withKnobs } from '@storybook/addon-knobs';
import { text } from '@storybook/addon-knobs/react';
import { storiesOf, StoryDecorator } from '@storybook/react';
import { CSSProperties } from 'react';

import { storiesOf, StoryDecorator } from '@storybook/react';
import { CodeEditor, ICodeEditor } from '../../CodeEditor';

const store = new Store({
Expand All @@ -17,7 +18,7 @@ const store = new Store({
export const codeEditorKnobs = (tabName = 'Code Editor'): ICodeEditor => ({
language: text('language', 'javascript', tabName),
value: text('value', 'const defaultValue = stoplight.io();', tabName),
style: object<React.CSSProperties>('style', { fontSize: '12px' }, tabName),
style: object<CSSProperties>('style', { fontSize: '12px' }, tabName),
});

storiesOf('Miscellaneous:CodeEditor', module)
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/ContextMenu.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('ContextMenuView component', () => {
});

it('should render as ReactContextMenu', () => {
const wrapper = shallow(<ContextMenuView id="t" />)
const wrapper = shallow(<ContextMenuView id="t" />);

expect(wrapper).toHaveProp('as', ReactContextMenu);
});
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Table.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('TableCell component', () => {
it('renders td by default', () => {
const wrapper = shallow(<TableCell as="td" />);
expect(wrapper).toHaveProp('as', 'td');
})
});

it('may render th', () => {
const wrapper = shallow(<TableCell as="th" />);
Expand Down

0 comments on commit 74286fa

Please sign in to comment.