@wordpress/block-library
Version:
Block library for the WordPress editor.
46 lines (43 loc) • 1.32 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = EnhancedPaginationControl;
var _components = require("@wordpress/components");
var _i18n = require("@wordpress/i18n");
var _utils = require("../../utils");
var _jsxRuntime = require("react/jsx-runtime");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function EnhancedPaginationControl({
enhancedPagination,
setAttributes,
clientId
}) {
const {
hasUnsupportedBlocks
} = (0, _utils.useUnsupportedBlocks)(clientId);
let help = (0, _i18n.__)('Reload the full page—instead of just the posts list—when visitors navigate between pages.');
if (hasUnsupportedBlocks) {
help = (0, _i18n.__)('Enhancement disabled because there are non-compatible blocks inside the Query block.');
}
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0, _i18n.__)('Reload full page'),
help: help,
checked: !enhancedPagination,
disabled: hasUnsupportedBlocks,
onChange: value => {
setAttributes({
enhancedPagination: !value
});
}
})
});
}
//# sourceMappingURL=enhanced-pagination-control.js.map
;