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