Skip to content

Commit

Permalink
Fix react warnings and Dots stories.
Browse files Browse the repository at this point in the history
  • Loading branch information
leMaik committed Sep 21, 2016
1 parent 6e10bd5 commit d74e31e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/AutoRotatingCarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class AutoRotatingCarousel extends Component {
{this.props.open ?
<div style={style.content}>
<Paper
zIndex={this.props.mobile ? 0 : 1}
zDepth={this.props.mobile ? 0 : 1}
style={style.carouselWrapper}>
<Carousel
autoplay={this.props.autoplay}
Expand All @@ -151,9 +151,10 @@ export class AutoRotatingCarousel extends Component {
onChangeIndex={(value) => this.handleChange(value)}
slideStyle={style.slide}
>
{this.props.children.map((c) => React.cloneElement(c, {
{this.props.children.map((c, i) => React.cloneElement(c, {
mobile: this.props.mobile,
landscape: this.props.landscape
landscape: this.props.landscape,
key: i
}))}
</Carousel>
</Paper>
Expand Down
10 changes: 8 additions & 2 deletions src/SwipableCarouselView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React, { PropTypes } from 'react'
import autoPlay from 'react-swipeable-views/lib/autoPlay'
import virtualize from 'react-swipeable-views/lib/virtualize'
import SwipeableViews from 'react-swipeable-views'
Expand All @@ -15,4 +15,10 @@ export default function Carousel ({ children, ...other }) {
)
}

Carousel.propTypes = VirtualizeAutoPlaySwipeViews.propTypes
if (process.env.NODE_ENV !== 'production') {
Carousel.propTypes = {
...VirtualizeAutoPlaySwipeViews.propTypes,
children: PropTypes.node
}
delete Carousel.propTypes.slideRenderer
}
2 changes: 1 addition & 1 deletion stories/AutoRotatingDots.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Dots } from '../src/Dots'
import Dots from '../src/Dots'

export default class extends React.Component {
constructor (props) {
Expand Down
2 changes: 1 addition & 1 deletion stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { storiesOf, action, linkTo } from '@kadira/storybook'
import { green400, green600, blue400, blue600, red400, red600 } from 'material-ui/styles/colors'
import { AutoRotatingCarousel, Slide } from '../src'
import { Dots } from '../src/Dots'
import Dots from '../src/Dots'
import { themed } from './storyUtil'
import AutoRotatingDots from './AutoRotatingDots'

Expand Down

0 comments on commit d74e31e

Please sign in to comment.