From 487bd14b0416ee3b5c6859cf8c491f0fbb99f7b6 Mon Sep 17 00:00:00 2001 From: vsevolod22 <96574851+vsevolod22@users.noreply.github.com> Date: Mon, 26 May 2025 00:45:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BB=D0=B0=D0=B9=D0=B4=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 17 + package.json | 1 + src/app/styles/App.scss | 5 +- src/widgets/Slider/Slider.styles.scss | 310 +++++++++++------ src/widgets/Slider/Slider.tsx | 155 ++++----- src/widgets/Slider/components/Dots.tsx | 3 +- src/widgets/Slider/components/SlidesList.tsx | 3 +- src/widgets/Slider/context.ts | 22 ++ src/widgets/WpPost/Projects.scss | 343 ++++++++++--------- src/widgets/WpPost/WpPost.tsx | 14 +- 10 files changed, 506 insertions(+), 367 deletions(-) create mode 100644 src/widgets/Slider/context.ts diff --git a/package-lock.json b/package-lock.json index ef4af04..468ec67 100755 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,7 @@ "persist": "^0.2.7", "pg": "^8.13.0", "react": "^18.3.1", + "react-alice-carousel": "^2.9.1", "react-chartjs-2": "^5.2.0", "react-dom": "^18.3.1", "react-fast-marquee": "^1.6.5", @@ -7877,6 +7878,17 @@ "node": ">=0.10.0" } }, + "node_modules/react-alice-carousel": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/react-alice-carousel/-/react-alice-carousel-2.9.1.tgz", + "integrity": "sha512-/wQE4cqogKL/db+SoiiRmdj5j6C9I31pfzrmz8nuXmWmSl/UxxJz/O92W/ryxicTw1au+3mUW+drU3ZAhF3JPA==", + "dependencies": { + "vanilla-swipe": "^2.4.1" + }, + "peerDependencies": { + "react": ">=15.4" + } + }, "node_modules/react-chartjs-2": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-5.3.0.tgz", @@ -8692,6 +8704,11 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, + "node_modules/vanilla-swipe": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/vanilla-swipe/-/vanilla-swipe-2.4.1.tgz", + "integrity": "sha512-o6pfI0dipet88ZnPLV4Jx04Ia+U3xANh14vhROW2TOe/mrwk2JGG68+Z0BPoD1YUcQQEnK4SZBXkqFe+K1l7/w==" + }, "node_modules/vite": { "version": "5.4.19", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.19.tgz", diff --git a/package.json b/package.json index 7528721..edcbaa0 100755 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "persist": "^0.2.7", "pg": "^8.13.0", "react": "^18.3.1", + "react-alice-carousel": "^2.9.1", "react-chartjs-2": "^5.2.0", "react-dom": "^18.3.1", "react-fast-marquee": "^1.6.5", diff --git a/src/app/styles/App.scss b/src/app/styles/App.scss index 23a8f71..9e94ac6 100644 --- a/src/app/styles/App.scss +++ b/src/app/styles/App.scss @@ -2,16 +2,17 @@ @import "global"; @import "variables/variables"; @import "reset"; -@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap'); +@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap"); @font-face { - font-family: 'Montserrat', sans-serif; + font-family: "Montserrat", sans-serif; font-style: normal; font-weight: 100 900; font-display: swap; } .app { min-height: 100%; + overflow: hidden; } #page { > #header, diff --git a/src/widgets/Slider/Slider.styles.scss b/src/widgets/Slider/Slider.styles.scss index 1ab7b94..5bbe758 100644 --- a/src/widgets/Slider/Slider.styles.scss +++ b/src/widgets/Slider/Slider.styles.scss @@ -1,136 +1,248 @@ .slider { - width: 100%; - margin: 0 auto; - position: relative; - padding: 10px 0; + width: 100%; + margin: 0 auto; + position: relative; + padding: 10px 0; + user-select: none; // Запрещаем выделение всего содержимого слайдера - &.has-pagination { - .swiper { - padding-bottom: 40px; - } + &.has-pagination { + .swiper { + padding-bottom: 40px; } + } - .swiper-slide { - display: flex; - justify-content: center; - align-items: center; + .slider-item { + display: flex; + justify-content: center; + align-items: center; - - .slide-image { - width: 100%; - height: auto; - height: 350px; - object-fit: cover; - object-position: center center; // - border-radius: 8px; - pointer-events: none; - } + .slide-image { + width: 100%; + height: auto; + height: 350px; + object-fit: cover; + object-position: center center; + border-radius: 8px; + pointer-events: none; + user-select: none; // Дополнительная защита от выделения изображений } + } - .swiper-wrapper:has(.swiper-slide.single) { - justify-content: center; + .swiper-wrapper:has(.swiper-slide.single) { + justify-content: center; - .swiper-slide.single { - display: flex; - justify-content: center; - align-items: center; + .slider-item.single { + display: flex; + justify-content: center; + align-items: center; - .slide-image { - width: auto; - height: 100%; - object-position: center center; - pointer-events: none; - border-radius: 0px; - } - } + .slide-image { + width: auto; + height: 100%; + object-position: center center; + pointer-events: none; + user-select: none; // Запрещаем выделение и для одиночных изображений + border-radius: 0px; + } } + } } /* стрелки */ /* Кастомные стрелки */ .custom-navigation { - display: flex; - justify-content: space-between; - align-items: center; - position: absolute; - top: 50%; - width: 100%; - transform: translateY(-50%); - z-index: 10; + display: flex; + justify-content: space-between; + align-items: center; + position: absolute; + top: 50%; + transform: translateY(-50%); + background: rgba(0, 0, 0, 0.7); + color: white; + border: none; + width: 40px; + height: 40px; + border-radius: 50%; + cursor: pointer; + font-size: 18px; + display: flex; + align-items: center; + justify-content: center; + z-index: 2; + transition: all 0.2s ease; + + &:hover { + background: rgba(0, 0, 0, 0.9); + transform: translateY(-50%) scale(1.1); + } + + &[disabled] { + display: none; + } +} +.alice-carousel__wrapper { + width: 185%; + height: auto; + left: -240px; + user-select: none; +} +.alice-carousel__prev-btn { + left: 10px; + + &::before { + content: "←"; + } } -.custom-prev, -.custom-next { - width: 60px; - height: 60px; - background-color: white; - border-radius: 50%; - display: flex; - justify-content: center; - align-items: center; - box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); - cursor: pointer; - font-size: 24px; - border: none; +.alice-carousel__next-btn { + right: 10px; + + &::before { + content: "→"; + } } -.custom-prev { - margin-left: -70px; +// Стили для Alice Carousel (добавить в конец файла) +.slider { + // Ваши существующие стили остаются без изменений - @media (max-width: 768px) { - margin-left: 0px; + // Стили для Alice Carousel + .alice-carousel { + &__wrapper { + position: relative; } -} -.custom-next { - margin-right: -70px; - - @media (max-width: 768px) { - margin-right: 0px; + &__stage { + padding: 0; } -} -.slider.news { - .swiper-slide { - opacity: 0.5; - transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out; - height: 65vh; + &__stage-item { + padding: 0 10px; + } - .slide-image { - height: 500px; + // Используем ваши оригинальные стили для кнопок навигации + &__prev-btn, + &__next-btn { + position: absolute; + top: 50%; + transform: translateY(-50%); + width: 60px; + height: 60px; + background-color: white; + border-radius: 50%; + display: flex; + justify-content: center; + align-items: center; + box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); + cursor: pointer; + font-size: 24px; + border: none; + z-index: 10; + } + + &__prev-btn { + left: -70px; + + &::before { + content: "‹"; + } + + @media (max-width: 768px) { + left: 0px; + } + } + + &__next-btn { + right: -70px; + + &::before { + content: "›"; + } + + @media (max-width: 768px) { + right: 0px; + } + } + + // Стили для точек навигации + &__dots { + display: flex; + justify-content: center; + gap: 8px; + margin-top: 15px; + + &-item { + width: 10px; + height: 10px; + border-radius: 50%; + background: rgba(0, 0, 0, 0.3); + cursor: pointer; + transition: all 0.2s ease; + border: none; + + &.__active { + background: #007bff; + transform: scale(1.2); } - @media (max-width: 768px) { - opacity: 1; - transition: none; - height: 48vh; - - .slide-image { - height: 350px; - } + &:hover { + background: rgba(0, 0, 0, 0.6); } + } } - .swiper-slide-active { - opacity: 1; + // Скрываем точки когда они отключены + &.__disabled-dots .alice-carousel__dots { + display: none; } - &.no-animation .swiper-slide { - transition: none; + // Скрываем кнопки когда они отключены + &.__disabled-buttons { + .alice-carousel__prev-btn, + .alice-carousel__next-btn { + display: none; + } + } + } +} + +.slider-item { + display: flex; + justify-content: center; + align-items: center; +} + +.slide-image { + width: 100%; + height: 300px; + object-fit: cover; + border-radius: 4px; + + @media (max-width: 768px) { + height: 250px; + } +} + +// Responsive стили +@media (max-width: 768px) { + .slider { + .alice-carousel__stage-item { + padding: 0 5px; } - .swiper-wrapper:has(.swiper-slide.single) { - justify-content: center !important; + .alice-carousel__prev-btn, + .alice-carousel__next-btn { + width: 35px; + height: 35px; + font-size: 16px; } - .swiper-slide-prev, - .swiper-slide-next { - opacity: 0.7; - transform: scale(0.9); - - @media (max-width: 768px) { - opacity: 1; - transform: none; - } + .alice-carousel__prev-btn { + left: 5px; } -} \ No newline at end of file + + .alice-carousel__next-btn { + right: 5px; + } + } +} diff --git a/src/widgets/Slider/Slider.tsx b/src/widgets/Slider/Slider.tsx index 9b39fc7..b5bc1a8 100644 --- a/src/widgets/Slider/Slider.tsx +++ b/src/widgets/Slider/Slider.tsx @@ -1,119 +1,100 @@ -import { createContext, useEffect, useState } from "react"; -import { Swiper, SwiperSlide } from "swiper/react"; -import { Navigation, Pagination } from "swiper/modules"; +import { useState } from "react"; +import AliceCarousel from "react-alice-carousel"; +import "react-alice-carousel/lib/alice-carousel.css"; import { useMedia } from "@/modules/media/hooks/useMedia"; - -import "swiper/css"; -import "swiper/css/navigation"; -import "swiper/css/pagination"; - -import "./Slider.styles.scss"; import { MediaItem } from "@/modules/media/api/get"; - import { SkeletonSlider } from "@/shared/Components/SkeletonSlider/SkeletonSlider"; - -interface SliderProps { - autoPlay?: boolean; - autoPlayTime?: number; - images?: string[]; - category?: string; - customPerSlide: number; -} - -interface SliderContextType { - slideNumber: number; - mediaList: MediaItem[]; - setSlideNumber?: (slideNumber: number) => void; - goToSlide: (slideNumber: number) => void; // Added for Dot component - slidesCount: number; // Added for Dots component -} - -export const SliderContext = createContext({ - slideNumber: 0, - mediaList: [], - goToSlide: () => { }, - slidesCount: 0, -}); +import "./Slider.styles.scss"; +import { SliderContext, SliderProps } from "@/widgets/Slider/context"; function Slider({ autoPlay = false, autoPlayTime = 3000, images, category = "gallery", - customPerSlide = 0, + customPerSlide = 6, }: SliderProps) { const { data: mediaData, isLoading, isError } = useMedia(); - const [enableButtons, setEnableButtons] = useState(false); const [slideNumber, setSlideNumber] = useState(0); const filteredMedia: MediaItem[] = images ? images.map((src, id) => ({ id, src, category: "", name: "" })) : mediaData?.filter((m) => m.category === category) || []; - useEffect(() => { - const count = filteredMedia.length; - const threshold = customPerSlide > 0 ? customPerSlide : 2; - setEnableButtons(count > threshold); - }, [filteredMedia, customPerSlide]); + const getSlidesPerView = (width: number = window.innerWidth) => { + if (customPerSlide > 0) return customPerSlide; + if (width < 768) return 1; + if (width < 1024) return 2; + if (width < 1920) return 10; + return 10; + }; + const currentSlidesPerView = getSlidesPerView(); - if (isLoading) - return ( -
- {[...Array(1)].map((_, index) => ( - - ))} -
- ); + const shouldShowNavigation = filteredMedia.length > currentSlidesPerView; + const shouldShowDots = filteredMedia.length > currentSlidesPerView; + + const responsive = { + 0: { items: 1 }, + 400: { items: 2 }, + 600: { items: 3 }, + 800: { items: 3 }, + 1000: { items: 4 }, + 1200: { items: 4 }, + 1400: { items: 5 }, + 1600: { items: 7 }, + }; + + console.log("responsive object:", responsive); + const items = filteredMedia.map((media) => ( +
+ {`slide-${media.id}`} +
+ )); + + const handleSlideChanged = (event: { item: number }) => { + setSlideNumber(event.item); + }; + + const goToSlide = (index: number) => { + setSlideNumber(index); + }; + + if (isLoading) return ; if (isError) return
Ошибка при загрузке медиа
; + if (filteredMedia.length === 0) + return
Нет изображений для отображения
; return (
- setSlideNumber(swiper.activeIndex)} - breakpoints={{ - 0: { slidesPerView: 1 }, - 768: { slidesPerView: 2 }, - 1024: { slidesPerView: customPerSlide > 0 ? customPerSlide : 2 }, - }} - loopAddBlankSlides={true} - > - {filteredMedia.map((media) => ( - - {`slide-${media.id}`} - - ))} - -
+ +
); } diff --git a/src/widgets/Slider/components/Dots.tsx b/src/widgets/Slider/components/Dots.tsx index 099dfb3..b56e88a 100644 --- a/src/widgets/Slider/components/Dots.tsx +++ b/src/widgets/Slider/components/Dots.tsx @@ -1,7 +1,8 @@ import { useContext } from "react"; -import { SliderContext } from "../Slider"; + import Dot from "./Dot"; // Fixed import - was incorrectly importing from "./Dots" import { ReactElement } from "react"; +import { SliderContext } from "@/widgets/Slider/context"; function Dots(): ReactElement { const { slidesCount } = useContext(SliderContext); diff --git a/src/widgets/Slider/components/SlidesList.tsx b/src/widgets/Slider/components/SlidesList.tsx index 237fd42..45656a6 100644 --- a/src/widgets/Slider/components/SlidesList.tsx +++ b/src/widgets/Slider/components/SlidesList.tsx @@ -1,7 +1,8 @@ import { useContext } from "react"; import Slide from "./Slide"; -import { SliderContext } from "../Slider"; + import { MediaItem } from "@/modules/media/api/get"; +import { SliderContext } from "@/widgets/Slider/context"; export default function SlidesList() { const { slideNumber, mediaList } = useContext(SliderContext); diff --git a/src/widgets/Slider/context.ts b/src/widgets/Slider/context.ts new file mode 100644 index 0000000..a874001 --- /dev/null +++ b/src/widgets/Slider/context.ts @@ -0,0 +1,22 @@ +import { MediaItem } from "@/modules/media/api/get"; +import { createContext } from "react"; +export interface SliderProps { + autoPlay?: boolean; + autoPlayTime?: number; + images?: string[]; + category?: string; + customPerSlide?: number; +} +interface SliderContextType { + slideNumber: number; + mediaList: MediaItem[]; + setSlideNumber?: (slideNumber: number) => void; + goToSlide: (slideNumber: number) => void; + slidesCount: number; +} +export const SliderContext = createContext({ + slideNumber: 0, + mediaList: [], + goToSlide: () => {}, + slidesCount: 0, +}); diff --git a/src/widgets/WpPost/Projects.scss b/src/widgets/WpPost/Projects.scss index c889dbb..9b99cc6 100644 --- a/src/widgets/WpPost/Projects.scss +++ b/src/widgets/WpPost/Projects.scss @@ -1,198 +1,201 @@ -$color-highlight: #072AC8; -$table-header-color: #EEEEEE; +$color-highlight: #072ac8; +$table-header-color: #eeeeee; $table-body-bg: #ffffff; -$color-usual: #ACACAC; +$color-usual: #acacac; $border-raduis: 16px; -$background-tape: #F5F5F7; +$background-tape: #f5f5f7; $slider: 476px; $swiper-button-size: 48px; $swiper-button-arrow-size: 20px; :root { - --wp--preset--spacing--10: 5%; - --wp--preset--spacing--20: 10%; - --wp--preset--spacing--30: 15%; - --wp--preset--spacing--40: 20%; - --wp--preset--spacing--50: 25%; - --wp--preset--spacing--60: 30%; + --wp--preset--spacing--10: 5%; + --wp--preset--spacing--20: 10%; + --wp--preset--spacing--30: 15%; + --wp--preset--spacing--40: 20%; + --wp--preset--spacing--50: 25%; + --wp--preset--spacing--60: 30%; } .project { - .header { + .header { + text-align: center; + margin-bottom: 2em; + } + + .wp-block-columns { + margin-bottom: 2em; + } + + .is-layout-flex { + display: flex; + justify-content: space-between; + gap: 2em; + + figure { + img { + max-width: 100%; + height: auto; + object-fit: contain !important; // Wordpress накидывает styles к элементу, приходится перебивать + } + } + } + + .has-text-align-center { + text-align: center; + } + + .has-text-align-justify { + text-align: justify; + } + + .is-style-rounded * { + border-radius: 16px; + } + + // "Цитаты" + .wp-block-pullquote { + * { + margin-bottom: 0; + } + + blockquote { + display: flex; + justify-content: center; + position: absolute; + left: 0; + width: 100%; + padding: 16px 0; + background: $background-tape; + + p { + display: inline-block; + max-width: 40%; text-align: center; - margin-bottom: 2em; + } } + } - .wp-block-columns { - margin-bottom: 2em; - } + // Таблица + .table-wrapper { + border: 1px solid $table-header-color; + border-radius: $border-raduis; + overflow-x: auto; + background: $table-header-color; - .is-layout-flex { - display: flex; - justify-content: space-between; - gap: 2em; + .comparison-table { + width: 100%; + border-collapse: separate; + border-spacing: 0; + font-size: 18px; + word-wrap: normal; - figure { - img { - max-width: 100%; - height: auto; - object-fit: contain !important; // Wordpress накидывает styles к элементу, приходится перебивать - } - } - } + th, + td { + max-width: 200px; + border: none; + padding: 12px 16px; + vertical-align: middle; + background: $table-body-bg; + } - .has-text-align-center { + tr:not(:last-child) th, + tr:not(:last-child) td { + border-bottom: 1px solid $table-header-color; + } + + tr:last-child th, + tr:last-child td { + border-bottom: 1px solid $table-body-bg; + } + + thead th { + background-color: $table-header-color; + font-weight: 400; + padding: 12px 16px; + border: none; + } + + tbody td:not(:first-child), + thead th:not(:first-child) { text-align: center; - } + } - .has-text-align-justify { - text-align: justify; - } + thead th.highlight { + font-weight: 600; + font-size: 24px; + border-radius: 10px 10px 0 0; + border-bottom: 1px solid $color-highlight; + color: #ffffff; + background-color: $color-highlight; + } - .is-style-rounded * { - border-radius: 16px; - } + tbody td.highlight { + border: 1px solid $color-highlight; + border-top: none; - // "Цитаты" - .wp-block-pullquote { - * { - margin-bottom: 0; - } - - blockquote { - display: flex; - justify-content: center; - position: absolute; - left: 0; - width: 100%; - padding: 16px 0; - background: $background-tape; - - p { - display: inline-block; - max-width: 40%; - text-align: center; - } + .icon { + filter: brightness(0) saturate(100%) invert(26%) sepia(94%) + saturate(2350%) hue-rotate(225deg) brightness(95%) contrast(93%); } + } } + } - // Таблица - .table-wrapper { - border: 1px solid $table-header-color; - border-radius: $border-raduis; - overflow-x: auto; - background: $table-header-color; + .slider { + margin-top: 2em; + padding: 0; - .comparison-table { - width: 100%; - border-collapse: separate; - border-spacing: 0; - font-size: 18px; - word-wrap: normal; + .swiper { + padding-top: 4em; + overflow: visible; + .swiper-wrapper { + left: -250px; + } + .swiper-wrapper .swiper-slide { + aspect-ratio: 1 / 1; + position: relative; - th, - td { - max-width: 200px; - border: none; - padding: 12px 16px; - vertical-align: middle; - background: $table-body-bg; - } - - tr:not(:last-child) th, - tr:not(:last-child) td { - border-bottom: 1px solid $table-header-color; - } - - tr:last-child th, - tr:last-child td { - border-bottom: 1px solid $table-body-bg; - } - - thead th { - background-color: $table-header-color; - font-weight: 400; - padding: 12px 16px; - border: none; - } - - tbody td:not(:first-child), - thead th:not(:first-child) { - text-align: center; - } - - thead th.highlight { - font-weight: 600; - font-size: 24px; - border-radius: 10px 10px 0 0; - border-bottom: 1px solid $color-highlight; - color: #ffffff; - background-color: $color-highlight; - } - - tbody td.highlight { - border: 1px solid $color-highlight; - border-top: none; - - .icon { - filter: brightness(0) saturate(100%) invert(26%) sepia(94%) saturate(2350%) hue-rotate(225deg) brightness(95%) contrast(93%); - } - } + .slide-image { + width: 100%; + height: 100%; + object-fit: cover; + border-radius: 0; } + } + + .swiper-button-prev, + .swiper-button-next { + background: url("/./src/shared/assets/images/arrow2-0.svg") center + center no-repeat; + top: calc($swiper-button-size / 2); + left: auto; + width: $swiper-button-size; + height: $swiper-button-size; + color: transparent; + + border: 2px solid black; + border-radius: 100%; + } + + .swiper-button-prev::after, + .swiper-button-next::after { + font-size: $swiper-button-arrow-size; + } + + .swiper-button-prev { + transform: scaleX(-1); + right: calc(24px + $swiper-button-size); + } + + .swiper-button-next { + right: 0; + } + + .swiper-pagination { + display: none; + } } - - .slider { - margin-top: 2em; - padding: 0; - - .swiper { - padding-top: 4em; - // overflow: unset; - - .swiper-wrapper .swiper-slide { - aspect-ratio: 1 / 1; - position: relative; - - .slide-image { - width: 100%; - height: 100%; - object-fit: cover; - border-radius: 0; - } - } - - - .swiper-button-prev, - .swiper-button-next { - background: url('/./src/shared/assets/images/arrow2-0.svg') center center no-repeat; - top: calc($swiper-button-size / 2); - left: auto; - width: $swiper-button-size; - height: $swiper-button-size; - color: transparent; - - border: 2px solid black; - border-radius: 100%; - } - - .swiper-button-prev::after, - .swiper-button-next::after { - font-size: $swiper-button-arrow-size; - } - - .swiper-button-prev { - transform: scaleX(-1); - right: calc(24px + $swiper-button-size); - } - - .swiper-button-next { - right: 0; - } - - .swiper-pagination { - display: none; - } - } - } -} \ No newline at end of file + } +} diff --git a/src/widgets/WpPost/WpPost.tsx b/src/widgets/WpPost/WpPost.tsx index bac9099..49f708a 100644 --- a/src/widgets/WpPost/WpPost.tsx +++ b/src/widgets/WpPost/WpPost.tsx @@ -13,15 +13,15 @@ interface WpPostProps { children?: ReactNode; } -export default function WpPost({ - post, - children, -}: WpPostProps) { - useResizeObserver({parentSelector: '.wp-block-pullquote', childSelector: 'blockquote'}); +export default function WpPost({ post, children }: WpPostProps) { + useResizeObserver({ + parentSelector: ".wp-block-pullquote", + childSelector: "blockquote", + }); //useResizeObserver({parentSelector: '.slider', childSelector: '.swiper-slide', margin: '5em'}); return ( -
+

{post.title}

@@ -31,7 +31,7 @@ export default function WpPost({ if (el.type === "mediablock") { return ; } else if (el.type === "slider") { - return + return ; } return
{el.element}
; })}