56 lines
1.2 KiB
JavaScript
56 lines
1.2 KiB
JavaScript
import { __ } from "@wordpress/i18n";
|
|
import "./editor.scss";
|
|
|
|
import {
|
|
useBlockProps,
|
|
RichText,
|
|
InnerBlocks,
|
|
InspectorControls,
|
|
} from "@wordpress/block-editor";
|
|
|
|
import { Tip, PanelBody } from "@wordpress/components";
|
|
|
|
export default function Edit({ attributes, setAttributes, clientId }) {
|
|
let { sectionTitle, sectionSubtitle } = attributes;
|
|
|
|
function onChangeSectionTitle(sectionTitle) {
|
|
setAttributes({ sectionTitle });
|
|
}
|
|
function onChangeSectionSubtitle(sectionSubtitle) {
|
|
setAttributes({ sectionSubtitle });
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<InspectorControls>
|
|
<PanelBody>
|
|
<Tip>salut</Tip>
|
|
</PanelBody>
|
|
</InspectorControls>
|
|
<div
|
|
{...useBlockProps({
|
|
className: `section_titling`,
|
|
})}
|
|
>
|
|
<RichText
|
|
value={sectionTitle}
|
|
tagName="h3"
|
|
className="section_titling__title"
|
|
placeholder={__(
|
|
"Ajouter ici le Titre de Section",
|
|
"homegrade-blocks__texte-backoffice"
|
|
)}
|
|
onChange={onChangeSectionTitle}
|
|
/>
|
|
<RichText
|
|
value={sectionSubtitle}
|
|
tagName="p"
|
|
className="section_titling__subtitle"
|
|
placeholder={__("Ajouter ici le Sous-titre", "homegrade")}
|
|
onChange={onChangeSectionSubtitle}
|
|
/>
|
|
</div>
|
|
</>
|
|
);
|
|
}
|