Skip to content
Permalink
Browse files

feat: add support for order

  • Loading branch information...
wengkhing
wengkhing committed Jan 16, 2018
1 parent fa11378 commit 2c7c8caf988b5b36555cf8e4f3c4b4d829819ba8
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/Block/index.js
@@ -22,6 +22,7 @@ const defaultChildProps = {
// =========================
const validBasisValue = /^[0-9]*(vw|px|vh|%)$/
const validGutterValue = /^[0-9]*px$/
const validOrderValue = /^[0-9]*$/

const Block = (props) => {
const { blockClassNames, blockStyle } = generateBlockClasses(props)
@@ -187,6 +188,12 @@ function generateChildClasses (props, parentLayout, gutter) {
console.warn(`'${gutter}' is not a valid value for property 'gutter'.\nPlease use numerical value postfix with 'px'. Example: 8px'`)
}

if (childProps.order && validOrderValue.test(childProps.order)) {
style.order = childProps.order
} else if (childProps.order) {
console.warn(`'${childProps.order}' is not a valid value for property 'order'.\nPlease use integer value.`)
}

return { childClassNames: classNames, childStyle: style }
}

0 comments on commit 2c7c8ca

Please sign in to comment.
You can’t perform that action at this time.