diff --git a/components/Form/CheckboxGroup/index.jsx b/components/Form/CheckboxGroup/index.jsx index 44cc5cd..6a2bbbb 100644 --- a/components/Form/CheckboxGroup/index.jsx +++ b/components/Form/CheckboxGroup/index.jsx @@ -26,9 +26,11 @@ class CheckboxGroup extends React.Component { const i = this.state.selected.indexOf(e.currentTarget.value); // Toggle element from the array - (i === -1) ? - newSelected.push(e.currentTarget.value) : + if (i === -1) { + newSelected.push(e.currentTarget.value); + } else { newSelected.splice(i, 1); + } // Set state this.setState({ @@ -38,7 +40,7 @@ class CheckboxGroup extends React.Component { const selectedArr = this.props.items.filter(item => ( this.state.selected.indexOf(item.value) !== -1 )); - this.props.onChange && this.props.onChange(selectedArr); + if (this.props.onChange) this.props.onChange(selectedArr); }); } @@ -48,8 +50,8 @@ class CheckboxGroup extends React.Component { return (
- {items.map((item, i) => ( -
+ {items.map(item => ( +
- {items.map((item, i) => ( -
+ {items.map(item => ( +
this.el = node} className="vizz-component-globe">
+
{ this.el = node; }} className="vizz-component-globe" /> ); } } GlobeComponent.defaultProps = { - width: 500, - height: 500, radius: 200, autorotate: true, velocity: 0.15, - scrollTop: 0, - basemapImage: earthImage + scrollTop: 0 +}; + +GlobeComponent.propTypes = { + radius: React.PropTypes.number, + autorotate: React.PropTypes.bool, + velocity: React.PropTypes.number, + scrollTop: React.PropTypes.number, + basemapImage: React.PropTypes.string, + earthBumpImage: React.PropTypes.string }; export default GlobeComponent; diff --git a/components/Modal/index.jsx b/components/Modal/index.jsx index bdffbbe..8e0dfc7 100644 --- a/components/Modal/index.jsx +++ b/components/Modal/index.jsx @@ -1,5 +1,4 @@ import React, { Component } from 'react'; -import './style.scss'; class Modal extends Component { diff --git a/components/Spinner/index.jsx b/components/Spinner/index.jsx index 1cb9cc6..20cb1c5 100644 --- a/components/Spinner/index.jsx +++ b/components/Spinner/index.jsx @@ -1,5 +1,4 @@ import React from 'react'; -import './style.scss'; function Spinner(props) { return ( diff --git a/components/SvgIcon/index.jsx b/components/SvgIcon/index.jsx index e2767c9..70f57fe 100644 --- a/components/SvgIcon/index.jsx +++ b/components/SvgIcon/index.jsx @@ -1,5 +1,4 @@ import React from 'react'; -import './style.scss'; export default function SvgIcon({ name, className }) { return ( diff --git a/components/styles.scss b/components/styles.scss new file mode 100644 index 0000000..27b0d3e --- /dev/null +++ b/components/styles.scss @@ -0,0 +1,6 @@ +@import 'Spinner/style'; +@import 'Globe/style'; +@import 'Modal/style'; +@import 'SvgIcon/style'; +@import 'Form/CheckboxGroup/style'; +@import 'Form/RadioGroup/style';