feat: criando componente para modificar o swiper

This commit is contained in:
Ana Carolina Duarte Cavalcante 2023-01-23 09:13:21 -03:00
parent 9a5dc81e4a
commit fce9bb36dc
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,3 @@
import Swiper from "./components/SwiperComponent/SwiperComponent";
export default Swiper;

View File

@ -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;