You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design/components/carousel/index.jsx

49 lines
1019 B
React

// matchMedia polyfill for
// https://github.com/WickyNilliams/enquire.js/issues/82
if (typeof window !== 'undefined') {
const matchMediaPolyfill = function matchMediaPolyfill() {
return {
matches: false,
addListener: function () {
},
removeListener: function () {
}
};
};
window.matchMedia = window.matchMedia || matchMediaPolyfill;
}
import Carousel from 'react-slick';
10 years ago
import React from 'react';
import assign from 'object-assign';
10 years ago
const AntCarousel = React.createClass({
10 years ago
getDefaultProps() {
return {
dots: true,
arrows: false
};
},
render() {
10 years ago
let props = assign({}, this.props);
10 years ago
if (props.effect === 'fade') {
props.fade = true;
props.draggable = false;
10 years ago
}
10 years ago
let className = 'ant-carousel';
10 years ago
if (props.vertical) {
className = className + ' ant-carousel-vertical';
}
return (
<div className={className}>
<Carousel {...props} />
</div>
);
}
});
export default AntCarousel;