adding Tip for Question InspectorControl
This commit is contained in:
parent
fd736818f2
commit
70e2e86528
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '93aa1bb3eceec274510e');
|
||||
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '813f4c366e397d0d4322');
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
|
||||
|
||||
|
||||
function OptionsSelectControl({
|
||||
setAttributes,
|
||||
relatedPostId
|
||||
|
|
@ -120,7 +121,7 @@ function OptionsSelectControl({
|
|||
value: relatedPostId,
|
||||
options: relatedQuestionPages,
|
||||
onChange: e => handleRelatedPostChange(e)
|
||||
})));
|
||||
}), relatedPostId && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Tip, null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Pour modifier le contenu de la question affichée ici, rendez-vous dans la fiche question correspondante.", "homegrade-blocks__texte-fonctionnel"))));
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -6,6 +6,8 @@ import {
|
|||
ComboboxControl,
|
||||
} from "@wordpress/components";
|
||||
import "./editor.scss";
|
||||
import { Tip } from "@wordpress/components";
|
||||
|
||||
import { useSelect } from "@wordpress/data";
|
||||
import { useEffect, useState } from "@wordpress/element";
|
||||
import { decodeEntities } from "@wordpress/html-entities";
|
||||
|
|
@ -126,6 +128,14 @@ export default function OptionsSelectControl({ setAttributes, relatedPostId }) {
|
|||
onChange={(e) => handleRelatedPostChange(e)}
|
||||
/>
|
||||
)}
|
||||
{relatedPostId && (
|
||||
<Tip>
|
||||
{__(
|
||||
"Pour modifier le contenu de la question affichée ici, rendez-vous dans la fiche question correspondante.",
|
||||
"homegrade-blocks__texte-fonctionnel"
|
||||
)}
|
||||
</Tip>
|
||||
)}
|
||||
</PanelBody>
|
||||
</InspectorControls>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { useEffect } from "@wordpress/element";
|
|||
import { decodeEntities } from "@wordpress/html-entities";
|
||||
import OptionsSelectControl from "./OptionsSelectControl";
|
||||
|
||||
|
||||
function parseBlockContentForTooltips(editorContent) {
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(editorContent, "text/html");
|
||||
|
|
@ -56,6 +57,8 @@ export default function Edit({ attributes, setAttributes }) {
|
|||
|
||||
return (
|
||||
<>
|
||||
|
||||
|
||||
<OptionsSelectControl
|
||||
relatedPostId={relatedPostId}
|
||||
setAttributes={setAttributes}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user