From ecc1b8feecb1af9b7b09d042534b9361537362c9 Mon Sep 17 00:00:00 2001 From: ilya-bkv Date: Mon, 13 Nov 2023 18:29:46 +0300 Subject: [PATCH] test import --- api/ssr.mjs | 6 +++--- .../_shared/SolidSwiper/ArticleCardSwiper.tsx | 11 ++--------- src/components/_shared/SolidSwiper/ImageSwiper.tsx | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/api/ssr.mjs b/api/ssr.mjs index 051d583d..6e0c7e21 100644 --- a/api/ssr.mjs +++ b/api/ssr.mjs @@ -1,8 +1,8 @@ import { renderPage } from 'vike/server' -// export const config = { -// runtime: 'edge' -// } +export const config = { + runtime: 'edge' +} export default async function handler(req, res) { const { url, cookies } = req diff --git a/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx b/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx index bbfec7a1..82dd8492 100644 --- a/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx +++ b/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx @@ -1,6 +1,6 @@ -import { createSignal, For, Show } from 'solid-js' +import { For, Show } from 'solid-js' import { Icon } from '../Icon' -import { register } from 'swiper/element/bundle' +import { register } from 'swiper/element' import SwiperCore, { Manipulation, Navigation, Pagination } from 'swiper' import { SwiperRef } from './swiper' import { clsx } from 'clsx' @@ -18,14 +18,8 @@ register() SwiperCore.use([Pagination, Navigation, Manipulation]) export const ArticleCardSwiper = (props: Props) => { - const [slideIndex, setSlideIndex] = createSignal(0) - const mainSwipeRef: { current: SwiperRef } = { current: null } - const handleSlideChange = () => { - setSlideIndex(mainSwipeRef.current.swiper.activeIndex) - } - return (
@@ -38,7 +32,6 @@ export const ArticleCardSwiper = (props: Props) => { ref={(el) => (mainSwipeRef.current = el)} centered-slides={true} observer={true} - onSlideChange={handleSlideChange} space-between={20} breakpoints={{ 576: { spaceBetween: 20, slidesPerView: 1.5 }, diff --git a/src/components/_shared/SolidSwiper/ImageSwiper.tsx b/src/components/_shared/SolidSwiper/ImageSwiper.tsx index 8b3a497c..8d51db03 100644 --- a/src/components/_shared/SolidSwiper/ImageSwiper.tsx +++ b/src/components/_shared/SolidSwiper/ImageSwiper.tsx @@ -3,7 +3,7 @@ import { MediaItem, UploadedFile } from '../../../pages/types' import { Icon } from '../Icon' import { Popover } from '../Popover' import { useLocalize } from '../../../context/localize' -import { register } from 'swiper/element/bundle' +import { register } from 'swiper/element' import { DropArea } from '../DropArea' import { createFileUploader } from '@solid-primitives/upload' import SwiperCore, { Manipulation, Navigation, Pagination } from 'swiper'