Skip to content

Commit

Permalink
removed webpack import
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsingal committed Feb 16, 2017
1 parent 4945c3f commit 3bae8d8
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 20 deletions.
12 changes: 7 additions & 5 deletions components/Form/CheckboxGroup/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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);
});
}

Expand All @@ -48,8 +50,8 @@ class CheckboxGroup extends React.Component {

return (
<div className={`c-checkbox-box ${this.props.className}`}>
{items.map((item, i) => (
<div key={i} className="c-checkbox">
{items.map(item => (
<div key={`c-checkbox-item-${name}`} className="c-checkbox">
<input
type="checkbox"
name={name}
Expand Down
6 changes: 3 additions & 3 deletions components/Form/RadioGroup/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class RadioGroup extends React.Component {
});

// Trigger change selected if it's needed
this.props.onChange && this.props.onChange(selectedObj);
if (this.props.onChange) this.props.onChange(selectedObj);
}

render() {
Expand All @@ -38,8 +38,8 @@ class RadioGroup extends React.Component {

return (
<div className={`c-radio-box ${this.props.className}`}>
{items.map((item, i) => (
<div key={i} className="c-radio">
{items.map(item => (
<div key={`c-radio-item-${name}`} className="c-radio">
<input
type="radio"
name={name}
Expand Down
21 changes: 12 additions & 9 deletions components/Globe/index.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React from 'react';
import * as THREE from 'three';
import orbitControl from 'three-orbit-controls';
import earthImage from './images/earth-clouds.jpg';
import earthBumpImage from './images/earth-bump.jpg';
import './style.scss';

const Control = orbitControl(THREE);

Expand Down Expand Up @@ -61,7 +58,7 @@ class GlobeComponent extends React.Component {
addGlobe() {
const material = new THREE.MeshPhongMaterial({
map: this.imageLoader.load(this.props.basemapImage),
bumpMap: this.imageLoader.load(earthBumpImage),
bumpMap: this.imageLoader.load(this.props.earthBumpImage),
bumpScale: 2
});
const geometry = new THREE.SphereGeometry(this.props.radius, 40, 30);
Expand All @@ -81,20 +78,26 @@ class GlobeComponent extends React.Component {

render() {
return (
<div ref={(node) => this.el = node} className="vizz-component-globe"></div>
<div ref={(node) => { 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;
1 change: 0 additions & 1 deletion components/Modal/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from 'react';
import './style.scss';

class Modal extends Component {

Expand Down
1 change: 0 additions & 1 deletion components/Spinner/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import './style.scss';

function Spinner(props) {
return (
Expand Down
1 change: 0 additions & 1 deletion components/SvgIcon/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import './style.scss';

export default function SvgIcon({ name, className }) {
return (
Expand Down
6 changes: 6 additions & 0 deletions components/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import 'Spinner/style';
@import 'Globe/style';
@import 'Modal/style';
@import 'SvgIcon/style';
@import 'Form/CheckboxGroup/style';
@import 'Form/RadioGroup/style';

0 comments on commit 3bae8d8

Please sign in to comment.