From b594d3098c8431d2c345a27561abe18c6d7a239b Mon Sep 17 00:00:00 2001 From: Adolfo Panizo Date: Sun, 16 Sep 2018 09:46:16 +0200 Subject: [PATCH] Adding undefined to getSize helper function --- src/components/layout/Hairline/index.js | 2 +- src/theme/size.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/layout/Hairline/index.js b/src/components/layout/Hairline/index.js index dae5ea6f..0dd0acb3 100644 --- a/src/components/layout/Hairline/index.js +++ b/src/components/layout/Hairline/index.js @@ -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, diff --git a/src/theme/size.js b/src/theme/size.js index 1d0f5526..49098ac1 100644 --- a/src/theme/size.js +++ b/src/theme/size.js @@ -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