Skip to content

Commit

Permalink
feat: add support for order
Browse files Browse the repository at this point in the history
  • Loading branch information
wengkhing committed Jan 16, 2018
1 parent fa11378 commit 2c7c8ca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Block/index.js
Expand Up @@ -22,6 +22,7 @@ const defaultChildProps = {
// ========================= // =========================
const validBasisValue = /^[0-9]*(vw|px|vh|%)$/ const validBasisValue = /^[0-9]*(vw|px|vh|%)$/
const validGutterValue = /^[0-9]*px$/ const validGutterValue = /^[0-9]*px$/
const validOrderValue = /^[0-9]*$/


const Block = (props) => { const Block = (props) => {
const { blockClassNames, blockStyle } = generateBlockClasses(props) const { blockClassNames, blockStyle } = generateBlockClasses(props)
Expand Down Expand Up @@ -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'`) 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 } return { childClassNames: classNames, childStyle: style }
} }


Expand Down

0 comments on commit 2c7c8ca

Please sign in to comment.