Skip to content
Permalink
Browse files

fix: warning missing radix argument

  • Loading branch information...
wengkhing
wengkhing committed Jan 15, 2018
1 parent 0ad3a94 commit fa113787954b1072bb9f14c1c8b8fbcd708d4af7
Showing with 13 additions and 11 deletions.
  1. +3 −3 src/App.js
  2. +8 −6 src/Block/index.js
  3. +2 −2 src/Block/style.css
@@ -7,10 +7,10 @@ class App extends Component {
render () {
return (
<div className='App'>
<Block layout='row' gutter='8px'>
<Block layout='row' gutter='8px' wrap style={{ backgroundColor: '#aaa' }}>
<div>Col 1</div>
<Block layout='column' basis='grow'>
<div basis='grow'>Nest 1</div>
<Block layout='row' basis='fill'>
<div basis='fill'>Nest 1</div>
<div>Nest 2</div>
</Block>
<div>Col 2</div>
@@ -68,9 +68,11 @@ function generateBlockClasses (props) {
case 'reverse':
classNames += ' up'
break
case false:
case 'none':
break
default:
console.warn(`'${blockProps.layout}' is not a valid value for property 'wrap'.\nDefault value 'down' will be used instead.`)
classNames += ' down'
console.warn(`'${blockProps.layout}' is not a valid value for property 'wrap'.\nDefault value 'none' will be used instead.`)
}

// Validate 'align' props and assign className accordingly
@@ -148,11 +150,11 @@ function generateChildClasses (props, parentLayout, gutter) {

// Validate 'basis' props and assign className and style accordingly
switch (childProps.basis) {
case 'grow':
classNames += ' grow'
case 'fill':
classNames += ' fill'
break
case 'auto':
classNames += ' no-grow'
classNames += ' no-fill'
break
default:
if (!validBasisValue.test(childProps.basis)) {
@@ -180,7 +182,7 @@ function generateChildClasses (props, parentLayout, gutter) {
}

if (gutter && validGutterValue.test(gutter)) {
style.margin = `${parseInt(gutter.replace('px', '')) / 2}px`
style.margin = `${parseInt(gutter.replace('px', ''), 10) / 2}px`
} else if (gutter) {
console.warn(`'${gutter}' is not a valid value for property 'gutter'.\nPlease use numerical value postfix with 'px'. Example: 8px'`)
}
@@ -71,12 +71,12 @@
flex-shrink: 1;
}

.awe-child.grow {
.awe-child.fill {
flex-grow: 1;
flex-basis: auto;
}

.awe-child.no-grow {
.awe-child.no-fill {
flex-grow: 0;
flex-basis: auto;
}

0 comments on commit fa11378

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