Skip to content

Commit

Permalink
Addon-docs Preview: Fix typescript types
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Aug 16, 2019
1 parent fd37514 commit abe72c7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/components/src/blocks/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { darken } from 'polished';

import { getBlockBackgroundStyle } from './BlockBackgroundStyles';
import { Source, SourceProps } from './Source';
import { ActionBar } from '../ActionBar/ActionBar';
import { ActionBar, ActionItem } from '../ActionBar/ActionBar';

export interface PreviewProps {
isColumn?: boolean;
Expand Down Expand Up @@ -57,7 +57,16 @@ const PreviewContainer = styled.div({
margin: '25px 0 40px',
});

const getSource = (withSource: SourceProps, expanded: boolean, setExpanded: Function) => {
interface SourceItem {
source?: React.ReactElement;
actionItem: ActionItem;
}

const getSource = (
withSource: SourceProps,
expanded: boolean,
setExpanded: Function
): SourceItem => {
switch (true) {
case !!(withSource && withSource.error): {
return {
Expand Down

0 comments on commit abe72c7

Please sign in to comment.