This repository has been archived on 2022-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
wp-red-orbiter/src/save.js

46 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-07-18 17:07:22 +00:00
/**
* Retrieves the translation of text.
*
* @see https://developer.wordpress.org/block-editor/packages/packages-i18n/
*/
2022-07-18 18:10:26 +00:00
import { __ } from "@wordpress/i18n";
2022-07-18 17:07:22 +00:00
/**
* React hook that is used to mark the block wrapper element.
* It provides all the necessary props like the class name.
*
* @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#useBlockProps
*/
2022-07-18 18:10:26 +00:00
import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
2022-07-18 17:07:22 +00:00
/**
* The save function defines the way in which the different attributes should
* be combined into the final markup, which is then serialized by the block
* editor into `post_content`.
*
* @see https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#save
*
* @return {WPElement} Element to render.
*/
2022-07-18 18:10:26 +00:00
export default function save({ attributes }) {
2022-07-18 17:07:22 +00:00
return (
2022-07-18 18:10:26 +00:00
<li
{...useBlockProps.save({
2022-07-19 10:13:58 +00:00
className: "orbiter",
2022-07-18 18:10:26 +00:00
})}
>
2022-07-19 10:13:58 +00:00
<div
className="orbiter-bg"
style={{
backgroundColor: attributes.backgroundColor,
}}
/>
<div className="orbiter-content content-center anti-clockwise">
2022-07-18 18:10:26 +00:00
<div className="feature">
<InnerBlocks.Content />
</div>
</div>
</li>
2022-07-18 17:07:22 +00:00
);
}