From 85c34b17aa074e67ed9263094cc0ee75a8f00e60 Mon Sep 17 00:00:00 2001 From: fragosti Date: Thu, 4 Oct 2018 14:04:56 -0700 Subject: Add Flex and Container component --- packages/instant/src/style/util.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 packages/instant/src/style/util.ts (limited to 'packages/instant/src/style/util.ts') diff --git a/packages/instant/src/style/util.ts b/packages/instant/src/style/util.ts new file mode 100644 index 000000000..7cf13133f --- /dev/null +++ b/packages/instant/src/style/util.ts @@ -0,0 +1,10 @@ +import * as _ from 'lodash'; + +export const cssRuleIfExists = (props: any, rule: string): string => { + const camelCaseRule = _.camelCase(rule); + const ruleValueIfExists = props[camelCaseRule]; + if (!_.isUndefined(ruleValueIfExists)) { + return `${rule}: ${ruleValueIfExists};`; + } + return ''; +}; -- cgit v1.2.3 From 0aa7bfab0d62a11e84b81044e6af6e2c5ec6b981 Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 10 Oct 2018 16:48:27 -0700 Subject: Add type to cssRuleIfExists --- packages/instant/src/style/util.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/instant/src/style/util.ts') diff --git a/packages/instant/src/style/util.ts b/packages/instant/src/style/util.ts index 7cf13133f..c9df0f834 100644 --- a/packages/instant/src/style/util.ts +++ b/packages/instant/src/style/util.ts @@ -1,6 +1,7 @@ +import { ObjectMap } from '@0xproject/types'; import * as _ from 'lodash'; -export const cssRuleIfExists = (props: any, rule: string): string => { +export const cssRuleIfExists = (props: ObjectMap, rule: string): string => { const camelCaseRule = _.camelCase(rule); const ruleValueIfExists = props[camelCaseRule]; if (!_.isUndefined(ruleValueIfExists)) { -- cgit v1.2.3 From 9f924e459c43c023e35ab7222cd9824cc0e67411 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 18 Oct 2018 21:51:56 +1100 Subject: chore: change package org from 0xproject to 0x --- packages/instant/src/style/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/instant/src/style/util.ts') diff --git a/packages/instant/src/style/util.ts b/packages/instant/src/style/util.ts index c9df0f834..3e38c4a7d 100644 --- a/packages/instant/src/style/util.ts +++ b/packages/instant/src/style/util.ts @@ -1,4 +1,4 @@ -import { ObjectMap } from '@0xproject/types'; +import { ObjectMap } from '@0x/types'; import * as _ from 'lodash'; export const cssRuleIfExists = (props: ObjectMap, rule: string): string => { -- cgit v1.2.3