You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

64 rivejä
2.7 KiB

  1. import React from "react";
  2. import { makeStyles } from "@material-ui/core/styles";
  3. import GridContainer from "components/Grid/GridContainer.js";
  4. import GridItem from "components/Grid/GridItem.js";
  5. import Card from "components/Card/Card.js";
  6. import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js";
  7. import Carousel from "react-slick";
  8. import Grid from '@material-ui/core/Grid';
  9. const useStyles = makeStyles(styles);
  10. const DataCarousel = function ({ backend, carousel, ...props }) {
  11. const classes = useStyles();
  12. const settings = {
  13. dots: true,
  14. infinite: true,
  15. speed: 500,
  16. slidesToShow: 1,
  17. slidesToScroll: 1,
  18. autoplay: true,
  19. time: 5
  20. };
  21. const Carousels = carousel.map((data) => {
  22. return (
  23. <div>
  24. <img src={`${backend}${data.img[0]["url"]}`} alt="First slide" className="slick-image" />
  25. </div>
  26. );
  27. })
  28. return (
  29. <div className = {classes.root} style={{marginTop:"-30px"}}>
  30. <Grid item xs={12} sm={12} className={classes.marginAuto}>
  31. <div className="container">
  32. <Carousel {...settings}>
  33. {Carousels}
  34. </Carousel>
  35. </div>
  36. </Grid>
  37. <Grid container style={{marginTop:"-40px"}}>
  38. <Grid item xs={6} className={classes.marginAuto}>
  39. <Card>
  40. <div className="container">
  41. <Carousel {...settings}>
  42. <iframe width="815" height="448" src="https://www.youtube.com/embed/ctv6XEB3ZT4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style={{height: "300px", width: "500px", display: "block"}}></iframe>
  43. </Carousel>
  44. </div>
  45. </Card>
  46. </Grid>
  47. <Grid item xs={6} className={classes.marginAuto}>
  48. <Card>
  49. <div className="container">
  50. <Carousel {...settings}>
  51. <iframe width="815" height="448" src="https://www.youtube.com/embed/sI3n7Fh8lrQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style={{height: "300px", width: "500px", display: "block"}}></iframe>
  52. </Carousel>
  53. </div>
  54. </Card>
  55. </Grid>
  56. </Grid>
  57. </div>
  58. );
  59. }
  60. export default DataCarousel;