UNPKG

@wordpress/block-library

Version:
49 lines (46 loc) 1.61 kB
"use strict"; 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); const fullPageClientSideNavigation = window.__experimentalFullPageClientSideNavigation; let help = (0, _i18n.__)('Reload the full page—instead of just the posts list—when visitors navigate between pages.'); if (fullPageClientSideNavigation) { help = (0, _i18n.__)('Experimental full-page client-side navigation setting enabled.'); } else 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 && !fullPageClientSideNavigation, disabled: hasUnsupportedBlocks || fullPageClientSideNavigation, onChange: value => { setAttributes({ enhancedPagination: !value }); } }) }); } //# sourceMappingURL=enhanced-pagination-control.js.map