From e66e5bf13364d5b0c6f0bc8385758294346e9ce9 Mon Sep 17 00:00:00 2001 From: andres alcocer Date: Wed, 6 Oct 2021 13:48:13 -0400 Subject: [PATCH] set swiper import styles --- src/containers/DisplayMovieRow.js | 9 ++++----- src/index.js | 3 +++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/containers/DisplayMovieRow.js b/src/containers/DisplayMovieRow.js index d0835fb..fa62208 100644 --- a/src/containers/DisplayMovieRow.js +++ b/src/containers/DisplayMovieRow.js @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { Swiper, SwiperSlide } from 'swiper/react'; import SwiperCore, { Navigation, Pagination, Scrollbar, A11y } from 'swiper'; + // install Swiper components SwiperCore.use([Navigation, Pagination, Scrollbar, A11y]); @@ -13,11 +14,11 @@ export default class DisplayMovieRow extends Component { } componentDidMount() { - window.addEventListener("resize", this.handleResize); + window.addEventListener('resize', this.handleResize); } componentWillUnMount() { - window.addEventListener("resize", this.handleResize); + window.addEventListener('resize', this.handleResize); } handleResize = (e) => { @@ -44,9 +45,7 @@ export default class DisplayMovieRow extends Component { draggable={false} loop={true} loopAdditionalSlides={ - width >= 1378 ? 4 : - width >= 998 ? 3 : - width >= 625 ? 2 : 2 + width >= 1378 ? 4 : width >= 998 ? 3 : width >= 625 ? 2 : 2 } breakpoints={{ 1378: { diff --git a/src/index.js b/src/index.js index a00a114..6f16c77 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,9 @@ import '@babel/polyfill'; import App from './containers/App'; // Import Swiper styles import 'swiper/css'; +import 'swiper/css/navigation'; +import 'swiper/css/pagination'; +// import 'swiper/css/scrollbar'; // Import main sass file to apply global styles import './static/sass/style.scss';