diff --git a/react/SwiperComponent.tsx b/react/SwiperComponent.tsx new file mode 100644 index 0000000..09a0c48 --- /dev/null +++ b/react/SwiperComponent.tsx @@ -0,0 +1,3 @@ +import Swiper from "./components/SwiperComponent/SwiperComponent"; + +export default Swiper; diff --git a/react/components/SwiperComponent/SwiperComponent.tsx b/react/components/SwiperComponent/SwiperComponent.tsx new file mode 100644 index 0000000..782fe36 --- /dev/null +++ b/react/components/SwiperComponent/SwiperComponent.tsx @@ -0,0 +1,21 @@ +const Swiper = () => { + if (typeof document !== "undefined") { + const SwiperContainer = document.querySelector(".swiper-container"); + const SwiperWrapper = document.querySelector(".swiper-wrapper"); + if (SwiperContainer) { + SwiperContainer.classList.remove("swiper-container-vertical"); + SwiperContainer.classList.add("swiper-container-horizontal"); + SwiperContainer.classList.add( + "vtex-store-components-3-x-swiper-component" + ); + } + if (SwiperWrapper) { + SwiperWrapper.classList.add( + "vtex-store-components-3-x-swiper-wrapper-style" + ); + } + } + return null; +}; + +export default Swiper;