diff options
author | Steve Klebanoff <steve@0xproject.com> | 2018-12-20 02:04:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-20 02:04:41 +0800 |
commit | 97e21106e5a96809e6298999b93833c4645dffba (patch) | |
tree | ed94468ed83f08410f53a09f65506b972be4e5d9 /packages/website/ts/@next/constants/utilities.tsx | |
parent | 6e4cb0246ccd46e69feea5a4324f3a5307df9c3f (diff) | |
parent | 125a940560a01305781bfb6754f52fa64669a6f3 (diff) | |
download | dexon-sol-tools-97e21106e5a96809e6298999b93833c4645dffba.tar dexon-sol-tools-97e21106e5a96809e6298999b93833c4645dffba.tar.gz dexon-sol-tools-97e21106e5a96809e6298999b93833c4645dffba.tar.bz2 dexon-sol-tools-97e21106e5a96809e6298999b93833c4645dffba.tar.lz dexon-sol-tools-97e21106e5a96809e6298999b93833c4645dffba.tar.xz dexon-sol-tools-97e21106e5a96809e6298999b93833c4645dffba.tar.zst dexon-sol-tools-97e21106e5a96809e6298999b93833c4645dffba.zip |
Merge pull request #1448 from 0xProject/feature/website/0x-org
[website][react-shared][instant] 0x org
Diffstat (limited to 'packages/website/ts/@next/constants/utilities.tsx')
-rw-r--r-- | packages/website/ts/@next/constants/utilities.tsx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/website/ts/@next/constants/utilities.tsx b/packages/website/ts/@next/constants/utilities.tsx new file mode 100644 index 000000000..ee5c5b4ce --- /dev/null +++ b/packages/website/ts/@next/constants/utilities.tsx @@ -0,0 +1,22 @@ +export interface PaddingInterface { + padding?: number | Array<'large' | 'default' | 'small' | number>; + margin?: number | Array<'large' | 'default' | 'small' | number>; +} + +interface PaddingSizes { + [key: string]: string; +} + +export const PADDING_SIZES: PaddingSizes = { + default: '30px', + large: '60px', + small: '15px', +}; + +export const getCSSPadding = (value: number | Array<string | number> = 0): string => { + if (Array.isArray(value)) { + return value.map(val => PADDING_SIZES[val] || `${val}px`).join(' '); + } else { + return `${value}px`; + } +}; |