diff options
author | Ezekiel Aquino <ezekiel@bakkenbaeck.no> | 2018-11-30 22:10:52 +0800 |
---|---|---|
committer | Ezekiel Aquino <ezekiel@bakkenbaeck.no> | 2018-11-30 22:11:09 +0800 |
commit | 6bf988942936a8cbb7a42a2fed9b586b16c65029 (patch) | |
tree | d8a6f3ee0abe3056e8487f23a72aee2a44d03f41 /packages/website/ts/@next/components/layout.tsx | |
parent | 7f8b9ef1f7623ca5ec6660ec67642eabc1456ebe (diff) | |
download | dexon-0x-contracts-6bf988942936a8cbb7a42a2fed9b586b16c65029.tar.gz dexon-0x-contracts-6bf988942936a8cbb7a42a2fed9b586b16c65029.tar.zst dexon-0x-contracts-6bf988942936a8cbb7a42a2fed9b586b16c65029.zip |
Types return on layout methods
Diffstat (limited to 'packages/website/ts/@next/components/layout.tsx')
-rw-r--r-- | packages/website/ts/@next/components/layout.tsx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/packages/website/ts/@next/components/layout.tsx b/packages/website/ts/@next/components/layout.tsx index 4621d1e8e..a9e95f13c 100644 --- a/packages/website/ts/@next/components/layout.tsx +++ b/packages/website/ts/@next/components/layout.tsx @@ -42,23 +42,19 @@ interface GetColWidthArgs { columns: number; } -const _getColumnWidth = (args: GetColWidthArgs) => { +const _getColumnWidth = (args: GetColWidthArgs): string => { const { span = 1, columns } = args; const percentWidth = (span / columns) * 100; const gutterDiff = (GUTTER * (columns - 1)) / columns; return `calc(${percentWidth}% - ${gutterDiff}px)`; }; -const _getPadding = (value: number | (string | number)[]) => { - let padding: string = ''; - +const _getPadding = (value: number | (string | number)[]): string => { if (Array.isArray(value)) { - padding = value.map(val => PADDING_SIZES[val] || `${val}px`).join(' '); + return value.map(val => PADDING_SIZES[val] || `${val}px`).join(' '); } else { - padding = `${value}px`; + return `${value}px`; } - - return padding; } const GUTTER = 30 as number; |