Skip to content

Commit

Permalink
Updated typings
Browse files Browse the repository at this point in the history
  • Loading branch information
eneufeld authored and edgarmueller committed Jun 15, 2018
1 parent 1c8e1d6 commit df067e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/vanilla/src/reducers/styling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const findStyle = (styles: StyleDef[]) => (style: string, ...args: any[])

const foundStyle = _.find(styles, s => s.name === style);
if (!_.isEmpty(foundStyle) && typeof foundStyle.classNames === 'function') {
return foundStyle.classNames(args);
return foundStyle.classNames(...args);
} else if (!_.isEmpty(foundStyle)) {
return foundStyle.classNames as string[];
}
Expand Down
4 changes: 2 additions & 2 deletions packages/vanilla/src/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { VanillaControlStateProps, VanillaLayoutProps } from '../index';
*/
export interface StyleDef {
name: string;
classNames: string[] | ((args: any[]) => string[]);
classNames: string[] | ((...args: any[]) => string[]);
}

/**
Expand Down Expand Up @@ -155,7 +155,7 @@ export const vanillaStyles = [
},
{
name: 'horizontal.layout.item',
classNames: numberOfChildren => ['horizontal-layout-' + numberOfChildren[0]]
classNames: ([size, _else]) => [`horizontal-layout-${size}`]
},
{
name: 'vertical.layout',
Expand Down

0 comments on commit df067e5

Please sign in to comment.