Skip to content

Commit

Permalink
fix(spacing): fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
raff-r committed Jul 2, 2020
1 parent 5332fe4 commit da4c28b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/styles/Spacing.ts
@@ -1,11 +1,12 @@
import { css } from 'styled-components';
import { spacing as spacingSizes, grid } from '../../constants';
import { GridBreakpoints } from '../../constants/grid';
import { Spacing } from '../../constants/spacing';

type SpacingTypes = 'margin' | 'padding';

const createTopLevelSizes = (type: SpacingTypes) => {
const sizes = type === 'margin' ? { ...spacingSizes, auto: 'auto' } : { ...spacingSizes };
const sizes: Spacing = type === 'margin' ? { ...spacingSizes, auto: 'auto' } : { ...spacingSizes };

return Object.keys(sizes).reduce(
(classNames, size) => ({
Expand Down Expand Up @@ -39,7 +40,7 @@ const createTopLevelSizes = (type: SpacingTypes) => {
};

const createResponsiveSizes = (type: SpacingTypes) => {
const sizes = type === 'margin' ? { ...spacingSizes, auto: 'auto' } : { ...spacingSizes };
const sizes: Spacing = type === 'margin' ? { ...spacingSizes, auto: 'auto' } : { ...spacingSizes };

return Object.keys(grid.breakpoints)
.filter((v) => v !== 'xs')
Expand Down
2 changes: 1 addition & 1 deletion src/constants/spacing.ts
@@ -1,4 +1,4 @@
type Spacing = Record<string, string>;
export type Spacing = Record<string, string>;

export const spacing: Spacing = {
'0': '0',
Expand Down

0 comments on commit da4c28b

Please sign in to comment.