From e13e630cd6e4fc0b1ff92098a28a770794c7bb9a Mon Sep 17 00:00:00 2001 From: gabrhr <73925454+gabrhr@users.noreply.github.com> Date: Wed, 20 Apr 2022 10:19:29 -0500 Subject: =?UTF-8?q?A=C3=B1adir=20plantilla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Base para front --- .../app/components/Widget/CarouselWidget.js | 117 +++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 front/odiparpack/app/components/Widget/CarouselWidget.js (limited to 'front/odiparpack/app/components/Widget/CarouselWidget.js') diff --git a/front/odiparpack/app/components/Widget/CarouselWidget.js b/front/odiparpack/app/components/Widget/CarouselWidget.js new file mode 100644 index 0000000..51dd522 --- /dev/null +++ b/front/odiparpack/app/components/Widget/CarouselWidget.js @@ -0,0 +1,117 @@ +import React from 'react'; +import Slider from 'react-slick'; +import PropTypes from 'prop-types'; +import { withStyles } from '@material-ui/core/styles'; +import ArrowForward from '@material-ui/icons/ArrowForward'; +import ArrowBack from '@material-ui/icons/ArrowBack'; +import carouselData from 'ba-api/carouselData'; +import 'ba-styles/vendors/slick-carousel/slick-carousel.css'; +import 'ba-styles/vendors/slick-carousel/slick.css'; +import 'ba-styles/vendors/slick-carousel/slick-theme.css'; +import { Typography, IconButton, Icon } from '@material-ui/core'; +import styles from './widget-jss'; + + +function SampleNextArrow(props) { + const { onClick } = props; + return ( + + + + ); +} + +SampleNextArrow.propTypes = { + onClick: PropTypes.func, +}; + +SampleNextArrow.defaultProps = { + onClick: undefined, +}; + +function SamplePrevArrow(props) { + const { onClick } = props; + return ( + + + + ); +} + +SamplePrevArrow.propTypes = { + onClick: PropTypes.func, +}; + +SamplePrevArrow.defaultProps = { + onClick: undefined, +}; + +class CarouselWidget extends React.Component { + render() { + const { classes } = this.props; + const settings = { + dots: true, + infinite: true, + centerMode: false, + speed: 500, + autoplaySpeed: 5000, + pauseOnHover: true, + autoplay: true, + slidesToShow: 3, + slidesToScroll: 1, + responsive: [ + { + breakpoint: 960, + settings: { + slidesToShow: 2, + slidesToScroll: 1, + infinite: true, + dots: true + } + }, + { + breakpoint: 600, + settings: { + slidesToShow: 1, + slidesToScroll: 1, + infinite: true, + dots: true + } + }, + ], + cssEase: 'ease-out', + nextArrow: , + prevArrow: + }; + return ( +
+ + {carouselData.map((item, index) => ( +
+
+ {item.icon} + + {item.icon} + {item.title} + + {item.desc} +
+
+ ))} +
+
+ ); + } +} + +CarouselWidget.propTypes = { + classes: PropTypes.object.isRequired, +}; + +export default withStyles(styles)(CarouselWidget); -- cgit v1.2.3