Adding undefined to getSize helper function
This commit is contained in:
parent
9b6feafb36
commit
b594d3098c
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue