Skip to content

Commit

Permalink
fix: layout item renderMedia
Browse files Browse the repository at this point in the history
  • Loading branch information
qradle-yndx committed Jan 17, 2024
1 parent ce716fc commit 2ef9a29
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/sub-blocks/LayoutItem/LayoutItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,32 @@ const LayoutItem = ({
size: 's',
colSizes: {all: 12, md: 12},
};
return (
<div className={b(null, className)}>
{media ? (
fullscreen && hasFullscreen(media) ? (
<FullscreenMedia showFullscreenIcon={showFullscreenIcon(media)}>
{({
className: mediaClassName,
fullscreen: _fullscreen,
...fullscreenMediaProps
} = {}) => (
<Media
{...media}
{...fullscreenMediaProps}
className={b('media', {border}, mediaClassName)}
analyticsEvents={analyticsEvents}
/>
)}
</FullscreenMedia>
) : (
const renderMedia = () => {
if (!media) {
return null;
}
return fullscreen && hasFullscreen(media) ? (
<FullscreenMedia showFullscreenIcon={showFullscreenIcon(media)}>
{({
className: mediaClassName,
fullscreen: _fullscreen,
...fullscreenMediaProps
} = {}) => (
<Media
{...media}
className={b('media', {border})}
{...fullscreenMediaProps}
className={b('media', {border}, mediaClassName)}
analyticsEvents={analyticsEvents}
/>
)
) : null}
)}
</FullscreenMedia>
) : (
<Media {...media} className={b('media', {border})} analyticsEvents={analyticsEvents} />
);
};
return (
<div className={b(null, className)}>
{renderMedia()}
{metaInfo && <MetaInfo items={metaInfo} className={b('meta-info')} />}
<div className={b('content', {'no-media': !media})}>
<IconContent icon={icon} content={contentProps} />
Expand Down

0 comments on commit 2ef9a29

Please sign in to comment.