4 * Copyright 2016 RIFT.IO Inc
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 var React = require('react');
20 var Slider = require('react-slick');
21 // require('../../components/gauge/gauge.js');
22 // require('../../components/text-area/rw.text-area.js');
23 // require('../../components/test/multicomponent.js');
24 import button from '../../components/components.js'
26 require('./carousel.css');
27 var SimpleSlider = React.createClass({
29 component_list: React.PropTypes.array.isRequired,
30 slideno: React.PropTypes.number
32 handleClick: function() {
35 getInitialState: function() {
40 shouldComponentUpdate: function(nextProps) {
42 if (nextProps.slideno != this.props.slideno) {
55 // initialSlide: this.props.slideno || 2
64 initialSlide: this.props.slideno || 0
66 setTimeout(function() {
67 window.dispatchEvent(new Event('resize'));
70 if (this.props.component_list !== undefined) {
71 for (var i = 0; i < this.props.component_list.length; i++) {
72 list.push(<div key={i} className={"component"}>{this.props.component_list[i]}</div>);
77 <Slider {...settings}>
84 module.exports = SimpleSlider;