adapting namespace & refactoring few bugs

This commit is contained in:
Antoine M 2023-10-25 14:38:20 +02:00
parent 07b386d696
commit b1d8177676
6 changed files with 9 additions and 13 deletions

View File

@ -64,7 +64,7 @@ export default function Edit({ attributes, setAttributes }) {
<InspectorControls> <InspectorControls>
<PanelBody <PanelBody
className="homegrade-blocks-content-page-header__panel-cta" className="homegrade-blocks-content-page-header__panel-cta"
title={__("Call to action", "homegrade-blocks__texte-fonctionnel")} title={__("Call to action", "homegrade-blocks__texte-backoffice")}
> >
<ToggleControl <ToggleControl
label="Afficher un call to action" label="Afficher un call to action"
@ -83,7 +83,7 @@ export default function Edit({ attributes, setAttributes }) {
label="Lien du cta" label="Lien du cta"
title={__( title={__(
"Call to action", "Call to action",
"homegrade-blocks__texte-fonctionnel" "homegrade-blocks__texte-backoffice"
)} )}
value={cta} value={cta}
onChange={onChangeCTA} onChange={onChangeCTA}

View File

@ -1,3 +1,3 @@
<p <?php echo get_block_wrapper_attributes(); ?>> <p <?php echo get_block_wrapper_attributes(); ?>>
<?php esc_html_e( 'Test hello from a dynamic block!', 'test' ); ?> Test hello from a dynamic block!
</p> </p>

View File

@ -1,3 +1,3 @@
<p <?php echo get_block_wrapper_attributes(); ?>> <p <?php echo get_block_wrapper_attributes(); ?>>
<?php esc_html_e( 'Test hello from a dynamic block!', 'test' ); ?> Test hello from a dynamic block!
</p> </p>

View File

@ -111,7 +111,7 @@ export default function OptionsSelectControl({ setAttributes, relatedPostId }) {
return ( return (
<InspectorControls> <InspectorControls>
<PanelBody <PanelBody
title={__("Question Relié", "homegrade-blocks__texte-fonctionnel")} title={__("Question Relié", "homegrade-blocks__texte-backoffice")}
> >
{/* <SelectControl {/* <SelectControl
label={panelTitle} label={panelTitle}

View File

@ -8,7 +8,6 @@ import { useEffect } from "@wordpress/element";
import { decodeEntities } from "@wordpress/html-entities"; import { decodeEntities } from "@wordpress/html-entities";
import OptionsSelectControl from "./OptionsSelectControl"; import OptionsSelectControl from "./OptionsSelectControl";
function parseBlockContentForTooltips(editorContent) { function parseBlockContentForTooltips(editorContent) {
const parser = new DOMParser(); const parser = new DOMParser();
const doc = parser.parseFromString(editorContent, "text/html"); const doc = parser.parseFromString(editorContent, "text/html");
@ -57,8 +56,6 @@ export default function Edit({ attributes, setAttributes }) {
return ( return (
<> <>
<OptionsSelectControl <OptionsSelectControl
relatedPostId={relatedPostId} relatedPostId={relatedPostId}
setAttributes={setAttributes} setAttributes={setAttributes}
@ -74,7 +71,7 @@ export default function Edit({ attributes, setAttributes }) {
<p> <p>
{__( {__(
"Ce bloc n'est relié à aucune question. Rattachez-le à une fiche question dans la barre latérale.", "Ce bloc n'est relié à aucune question. Rattachez-le à une fiche question dans la barre latérale.",
"homegrade-blocks__texte-fonctionnel" "homegrade-blocks__texte-backoffice"
)} )}
</p> </p>
</> </>

View File

@ -13,11 +13,11 @@ import {
ToolbarGroup, ToolbarGroup,
ToolbarButton, ToolbarButton,
Button, Button,
Tip,
} from "@wordpress/components"; } from "@wordpress/components";
import { useEffect } from "@wordpress/element"; import { useEffect } from "@wordpress/element";
import { MediaReplaceFlow, MediaPlaceholder } from "@wordpress/block-editor"; import { MediaReplaceFlow, MediaPlaceholder } from "@wordpress/block-editor";
import { trash } from "@wordpress/icons"; import { trash } from "@wordpress/icons";
import { Tip } from "@wordpress/components";
export default function Edit({ attributes, setAttributes, ...props }) { export default function Edit({ attributes, setAttributes, ...props }) {
let { let {
timelineStepTitle, timelineStepTitle,
@ -41,7 +41,6 @@ export default function Edit({ attributes, setAttributes, ...props }) {
setAttributes({ timelineStepSubtitle }); setAttributes({ timelineStepSubtitle });
} }
function setImageAttributes(media) { function setImageAttributes(media) {
console.log(media);
if (!media || !media.url) { if (!media || !media.url) {
setAttributes({ setAttributes({
timelineStepImageUrl: null, timelineStepImageUrl: null,