UNPKG

@wordpress/block-library

Version:
72 lines (68 loc) 2.53 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _reactNative = require("react-native"); var _components = require("@wordpress/components"); var _blockEditor = require("@wordpress/block-editor"); var _i18n = require("@wordpress/i18n"); var _compose = require("@wordpress/compose"); var _icons = require("@wordpress/icons"); var _editor = _interopRequireDefault(require("./editor.scss")); var _jsxRuntime = require("react/jsx-runtime"); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function EditTitle({ getStylesFromColorScheme, title }) { const globalStyles = (0, _blockEditor.useGlobalStyles)(); const baseColors = globalStyles?.baseColors?.color; const lockIconStyle = [getStylesFromColorScheme(_editor.default.lockIcon, _editor.default.lockIconDark), baseColors && { color: baseColors.text }]; const titleStyle = [getStylesFromColorScheme(_editor.default.title, _editor.default.titleDark), baseColors && { color: baseColors.text }]; const infoIconStyle = [getStylesFromColorScheme(_editor.default.infoIcon, _editor.default.infoIconDark), baseColors && { color: baseColors.text }]; const separatorStyle = getStylesFromColorScheme(_editor.default.separator, _editor.default.separatorDark); return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, { style: _editor.default.titleContainer, children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: _editor.default.lockIconContainer, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, { label: (0, _i18n.__)('Lock icon'), icon: _icons.lock, size: 16, style: lockIconStyle }) }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, { numberOfLines: 1, style: titleStyle, children: title }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: _editor.default.helpIconContainer, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, { label: (0, _i18n.__)('Help icon'), icon: _icons.help, size: 20, style: infoIconStyle }) }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: separatorStyle })] }); } var _default = exports.default = (0, _compose.withPreferredColorScheme)(EditTitle); //# sourceMappingURL=edit-title.native.js.map