forked from M3-Academy/challenge-vtex-io
Entrega do Desafio #1
3
react/SwiperComponent.tsx
Normal file
3
react/SwiperComponent.tsx
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import Swiper from "./components/SwiperComponent/SwiperComponent";
|
||||||
|
|
||||||
|
export default Swiper;
|
21
react/components/SwiperComponent/SwiperComponent.tsx
Normal file
21
react/components/SwiperComponent/SwiperComponent.tsx
Normal 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;
|
Loading…
Reference in New Issue
Block a user