30 lines
598 B
JavaScript
30 lines
598 B
JavaScript
import {
|
|
useBlockProps,
|
|
MediaPlaceholder,
|
|
RichText,
|
|
BlockControls,
|
|
MediaReplaceFlow,
|
|
} from "@wordpress/block-editor";
|
|
export default function save({ attributes }) {
|
|
const { coverUrl, coverId, coverAlt, heightFixed } = attributes;
|
|
return (
|
|
<section
|
|
{...useBlockProps.save({
|
|
className: `homegrade-content-blocks-picture-banner`,
|
|
})}
|
|
>
|
|
{coverUrl && (
|
|
<div
|
|
className={`picture-container ${heightFixed ? "fixed-height" : ""}`}
|
|
>
|
|
<img
|
|
src={coverUrl}
|
|
alt={coverAlt}
|
|
className={`wp-image-${coverId}`}
|
|
/>
|
|
</div>
|
|
)}
|
|
</section>
|
|
);
|
|
}
|