aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzekiel Aquino <ezekiel@bakkenbaeck.no>2018-11-30 22:10:52 +0800
committerEzekiel Aquino <ezekiel@bakkenbaeck.no>2018-11-30 22:11:09 +0800
commit6bf988942936a8cbb7a42a2fed9b586b16c65029 (patch)
treed8a6f3ee0abe3056e8487f23a72aee2a44d03f41
parent7f8b9ef1f7623ca5ec6660ec67642eabc1456ebe (diff)
downloaddexon-sol-tools-6bf988942936a8cbb7a42a2fed9b586b16c65029.tar
dexon-sol-tools-6bf988942936a8cbb7a42a2fed9b586b16c65029.tar.gz
dexon-sol-tools-6bf988942936a8cbb7a42a2fed9b586b16c65029.tar.bz2
dexon-sol-tools-6bf988942936a8cbb7a42a2fed9b586b16c65029.tar.lz
dexon-sol-tools-6bf988942936a8cbb7a42a2fed9b586b16c65029.tar.xz
dexon-sol-tools-6bf988942936a8cbb7a42a2fed9b586b16c65029.tar.zst
dexon-sol-tools-6bf988942936a8cbb7a42a2fed9b586b16c65029.zip
Types return on layout methods
-rw-r--r--packages/website/ts/@next/components/layout.tsx12
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;