UNPKG

@atlaskit/editor-plugin-toolbar

Version:

Toolbar plugin for @atlaskit/editor-core

25 lines 902 B
import React from 'react'; import { useIntl } from 'react-intl'; import { toolbarMessages } from '@atlaskit/editor-common/messages'; import { ToolbarDropdownMenu, ToolbarTooltip, TextIcon } from '@atlaskit/editor-toolbar'; /** * Basic version of existing 'Text Styles' Menu - which doesn't dynamically change icon * and is also placeholder to render all other menus in the collapsed state. */ export const TextCollapsedMenu = ({ children }) => { const { formatMessage } = useIntl(); return /*#__PURE__*/React.createElement(ToolbarDropdownMenu, { iconBefore: /*#__PURE__*/React.createElement(TextIcon, { label: formatMessage(toolbarMessages.textStylesTooltip), size: "small" }), enableMaxHeight: true, tooltipComponent: /*#__PURE__*/React.createElement(ToolbarTooltip, { content: formatMessage(toolbarMessages.textStylesTooltip) }) }, children); };