Skip to content

Commit

Permalink
fix: del react fragment in fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Feb 28, 2024
1 parent ba4a5ae commit c5afa0e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 37 deletions.
28 changes: 13 additions & 15 deletions src/components/FullscreenImage/FullscreenImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,19 @@ const FullscreenImage = (props: FullscreenImageProps) => {
className={b('modal')}
contentClassName={b('modal-content')}
>
<React.Fragment>
<button
className={b('icon-wrapper', {visible: true})}
onClick={closeModal}
aria-label={i18n('close')}
>
<Icon
data={PreviewClose}
width={CLOSE_ICON_SIZE}
height={CLOSE_ICON_SIZE}
className={b('icon', {hover: true})}
/>
</button>
<Image {...props} className={b('modal-image', modalImageClass)} />
</React.Fragment>
<button
className={b('icon-wrapper', {visible: true})}
onClick={closeModal}
aria-label={i18n('close')}
>
<Icon
data={PreviewClose}
width={CLOSE_ICON_SIZE}
height={CLOSE_ICON_SIZE}
className={b('icon', {hover: true})}
/>
</button>
<Image {...props} className={b('modal-image', modalImageClass)} />
</Modal>
)}
</div>
Expand Down
42 changes: 20 additions & 22 deletions src/components/FullscreenMedia/FullscreenMedia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,28 +71,26 @@ const FullscreenMedia = ({children, showFullscreenIcon = true}: FullscreenMediaP
className={b('modal')}
contentClassName={b('modal-content')}
>
<React.Fragment>
<Button
className={b('icon-wrapper', {visible: true})}
onClick={closeModal}
size={'l'}
>
<Icon
data={PreviewClose}
width={CLOSE_ICON_SIZE}
height={CLOSE_ICON_SIZE}
className={b('icon', {hover: true})}
/>
</Button>
{children({
imageClassName: getMediaClass('image'),
videoClassName: getMediaClass('video'),
youtubeClassName: getMediaClass('youtube'),
fullscreen: true,
previewImg: undefined,
autoplay: true,
})}
</React.Fragment>
<Button
className={b('icon-wrapper', {visible: true})}
onClick={closeModal}
size={'l'}
>
<Icon
data={PreviewClose}
width={CLOSE_ICON_SIZE}
height={CLOSE_ICON_SIZE}
className={b('icon', {hover: true})}
/>
</Button>
{children({
imageClassName: getMediaClass('image'),
videoClassName: getMediaClass('video'),
youtubeClassName: getMediaClass('youtube'),
fullscreen: true,
previewImg: undefined,
autoplay: true,
})}
</Modal>
)}
</div>
Expand Down

0 comments on commit c5afa0e

Please sign in to comment.