UNPKG

@wordpress/block-library

Version:
48 lines (46 loc) 1.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = CommentsPaginationNextEdit; var _i18n = require("@wordpress/i18n"); var _blockEditor = require("@wordpress/block-editor"); var _jsxRuntime = require("react/jsx-runtime"); /** * WordPress dependencies */ const arrowMap = { none: '', arrow: '→', chevron: '»' }; function CommentsPaginationNextEdit({ attributes: { label }, setAttributes, context: { 'comments/paginationArrow': paginationArrow } }) { const displayArrow = arrowMap[paginationArrow]; return /*#__PURE__*/(0, _jsxRuntime.jsxs)("a", { href: "#comments-pagination-next-pseudo-link", onClick: event => event.preventDefault(), ...(0, _blockEditor.useBlockProps)(), children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.PlainText, { __experimentalVersion: 2, tagName: "span", "aria-label": (0, _i18n.__)('Newer comments page link'), placeholder: (0, _i18n.__)('Newer Comments'), value: label, onChange: newLabel => setAttributes({ label: newLabel }) }), displayArrow && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", { className: `wp-block-comments-pagination-next-arrow is-arrow-${paginationArrow}`, children: displayArrow })] }); } //# sourceMappingURL=edit.js.map