From 5e71294e7180f61b45e242a20280470d6b4f8730 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Wed, 12 Feb 2025 19:59:06 +0700 Subject: [PATCH] change photoswipe icons --- src/containers/dialogs/PhotoSwipe/index.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/containers/dialogs/PhotoSwipe/index.tsx b/src/containers/dialogs/PhotoSwipe/index.tsx index 4c3c6fdf..b5baccb7 100644 --- a/src/containers/dialogs/PhotoSwipe/index.tsx +++ b/src/containers/dialogs/PhotoSwipe/index.tsx @@ -1,10 +1,12 @@ import { useEffect } from 'react'; -import { observer } from 'mobx-react-lite'; -import { SlideData } from 'photoswipe/dist/types/slide/slide'; - import 'photoswipe/style.css'; +import { observer } from 'mobx-react-lite'; +import { SlideData } from 'photoswipe/dist/types/slide/slide'; +import { renderToStaticMarkup } from 'react-dom/server'; + +import { Icon } from '~/components/common/Icon'; import { imagePresets } from '~/constants/urls'; import { useWindowSize } from '~/hooks/dom/useWindowSize'; import { useModal } from '~/hooks/modal/useModal'; @@ -13,12 +15,15 @@ import { DialogComponentProps } from '~/types/modal'; import { getURL } from '~/utils/dom'; import styles from './styles.module.scss'; - export interface Props extends DialogComponentProps { items: IFile[]; index: number; } +const arrowNextSVG = renderToStaticMarkup(); +const arrowPrevSVG = renderToStaticMarkup(); +const closeSVG = renderToStaticMarkup(); + const padding = { top: 10, left: 10, right: 10, bottom: 10 } as const; const PhotoSwipe = observer(({ index, items }: Props) => { @@ -74,6 +79,9 @@ const PhotoSwipe = observer(({ index, items }: Props) => { zoom: false, counter: false, bgOpacity: 0.1, + arrowNextSVG, + arrowPrevSVG, + closeSVG, }); ps.on('destroy', hideModal);