|
| 1 | +"use client" |
| 2 | + |
| 3 | +import type { ChildOnlyProp } from "@/lib/types" |
| 4 | + |
| 5 | +import Translation from "@/components/Translation" |
| 6 | +import { |
| 7 | + Swiper, |
| 8 | + SwiperContainer, |
| 9 | + SwiperNavigation, |
| 10 | + SwiperSlide, |
| 11 | +} from "@/components/ui/swiper" |
| 12 | + |
| 13 | +import { trackCustomEvent } from "@/lib/utils/matomo" |
| 14 | + |
| 15 | +import useTranslation from "@/hooks/useTranslation" |
| 16 | + |
| 17 | +const H3 = (props: ChildOnlyProp) => ( |
| 18 | + <h3 className="text-xl font-semibold leading-xs md:text-2xl" {...props} /> |
| 19 | +) |
| 20 | + |
| 21 | +const WhySlider = () => { |
| 22 | + const { t } = useTranslation("page-what-is-ethereum") |
| 23 | + |
| 24 | + const slides = [ |
| 25 | + { eventName: "Payments slide" }, |
| 26 | + { eventName: "Time of crisis slide" }, |
| 27 | + { eventName: "Creators slide" }, |
| 28 | + { eventName: "Gamers slide" }, |
| 29 | + ] |
| 30 | + |
| 31 | + return ( |
| 32 | + <SwiperContainer className="rounded border bg-background p-8"> |
| 33 | + <Swiper |
| 34 | + onSlideChange={({ activeIndex }) => { |
| 35 | + trackCustomEvent({ |
| 36 | + eventCategory: `What is Ethereum - Slider`, |
| 37 | + eventAction: `Clicked`, |
| 38 | + eventName: slides[activeIndex].eventName, |
| 39 | + }) |
| 40 | + }} |
| 41 | + > |
| 42 | + <SwiperSlide> |
| 43 | + <div className="space-y-8"> |
| 44 | + <H3>{t("page-what-is-ethereum-slide-1-title")}</H3> |
| 45 | + <div className="mb-4 flex flex-col gap-6"> |
| 46 | + <p> |
| 47 | + <Translation id="page-what-is-ethereum:page-what-is-ethereum-slide-1-desc-1" /> |
| 48 | + </p> |
| 49 | + <p>{t("page-what-is-ethereum-slide-1-desc-2")}</p> |
| 50 | + </div> |
| 51 | + </div> |
| 52 | + </SwiperSlide> |
| 53 | + <SwiperSlide> |
| 54 | + <div className="space-y-8"> |
| 55 | + <H3>{t("page-what-is-ethereum-slide-2-title")}</H3> |
| 56 | + <div className="mb-4 flex flex-col gap-6"> |
| 57 | + <p>{t("page-what-is-ethereum-slide-2-desc-1")}</p> |
| 58 | + <p> |
| 59 | + <Translation id="page-what-is-ethereum:page-what-is-ethereum-slide-2-desc-2" /> |
| 60 | + </p> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + </SwiperSlide> |
| 64 | + <SwiperSlide> |
| 65 | + <div className="space-y-8"> |
| 66 | + <H3>{t("page-what-is-ethereum-slide-3-title")}</H3> |
| 67 | + <div className="mb-4 flex flex-col gap-6"> |
| 68 | + <p> |
| 69 | + <Translation id="page-what-is-ethereum:page-what-is-ethereum-slide-3-desc-1" /> |
| 70 | + </p> |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + </SwiperSlide> |
| 74 | + <SwiperSlide> |
| 75 | + <div className="space-y-8"> |
| 76 | + <H3>{t("page-what-is-ethereum-slide-4-title")}</H3> |
| 77 | + <div className="mb-4 flex flex-col gap-6"> |
| 78 | + <p>{t("page-what-is-ethereum-slide-4-desc-1")}</p> |
| 79 | + <p>{t("page-what-is-ethereum-slide-4-desc-2")}</p> |
| 80 | + </div> |
| 81 | + </div> |
| 82 | + </SwiperSlide> |
| 83 | + <SwiperNavigation /> |
| 84 | + </Swiper> |
| 85 | + </SwiperContainer> |
| 86 | + ) |
| 87 | +} |
| 88 | + |
| 89 | +export default WhySlider |
0 commit comments