@@ -3,11 +3,8 @@ import React, {CSSProperties, HTMLProps, useState} from 'react';
33import { ChevronsExpandUpRight , Xmark } from '@gravity-ui/icons' ;
44import { Icon , Modal } from '@gravity-ui/uikit' ;
55
6- import SliderBlock from '../../blocks/Slider/Slider' ;
7- import { ImageProps as ModelImageProps , SliderType } from '../../models' ;
86import { block } from '../../utils' ;
97import Image , { ImageProps } from '../Image/Image' ;
10- import { getMediaImage } from '../Media/Image/utils' ;
118
129import { i18n } from './i18n' ;
1310
@@ -18,22 +15,14 @@ export interface FullscreenImageProps extends ImageProps {
1815 modalImageClass ?: string ;
1916 imageStyle ?: CSSProperties ;
2017 extraProps ?: HTMLProps < HTMLDivElement > ;
21- sliderData ?: { items : ModelImageProps [ ] ; initialIndex : number } ;
2218}
2319
2420const b = block ( 'fullscreen-image' ) ;
2521const FULL_SCREEN_ICON_SIZE = 18 ;
2622const CLOSE_ICON_SIZE = 24 ;
2723
2824const FullscreenImage = ( props : FullscreenImageProps ) => {
29- const {
30- imageClassName,
31- sliderData,
32- modalImageClass,
33- imageStyle,
34- alt = i18n ( 'img-alt' ) ,
35- extraProps,
36- } = props ;
25+ const { imageClassName, modalImageClass, imageStyle, alt = i18n ( 'img-alt' ) , extraProps} = props ;
3726 const [ isOpened , setIsOpened ] = useState ( false ) ;
3827
3928 const openModal = ( ) => setIsOpened ( true ) ;
@@ -77,29 +66,7 @@ const FullscreenImage = (props: FullscreenImageProps) => {
7766 className = { b ( 'icon' , { hover : true } ) }
7867 />
7968 </ button >
80- { sliderData ? (
81- < div className = { b ( 'modal-slider' ) } >
82- < SliderBlock
83- initialIndex = { sliderData . initialIndex }
84- slidesToShow = { 1 }
85- type = { SliderType . MediaCard }
86- >
87- { sliderData . items . map ( ( item , index ) => (
88- < div key = { index } className = { b ( 'modal-slider_item' ) } >
89- < Image
90- className = { b (
91- 'modal-slider_item-image' ,
92- modalImageClass ,
93- ) }
94- { ...getMediaImage ( item ) }
95- />
96- </ div >
97- ) ) }
98- </ SliderBlock >
99- </ div >
100- ) : (
101- < Image { ...props } className = { b ( 'modal-image' , modalImageClass ) } />
102- ) }
69+ < Image { ...props } className = { b ( 'modal-image' , modalImageClass ) } />
10370 </ Modal >
10471 ) }
10572 </ div >
0 commit comments