Adding undefined to getSize helper function

This commit is contained in:
Adolfo Panizo 2018-09-16 09:46:16 +02:00
parent 9b6feafb36
commit b594d3098c
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import * as React from 'react'
import { type Size, getSize } from '~/theme/size'
import { border } from '~/theme/variables'
const calculateStyleFrom = (margin: Size) => ({
const calculateStyleFrom = (margin?: Size) => ({
width: '100%',
height: '1px',
backgroundColor: border,

View File

@ -3,7 +3,7 @@ import { xs, sm, md, lg, xl } from '~/theme/variables'
export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
export const getSize = (size: Size) => {
export const getSize = (size: Size | typeof undefined) => {
switch (size) {
case 'xs':
return xs