UNPKG

@douyinfe/semi-ui

Version:

A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.

33 lines 898 B
import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { cssClasses } from '@douyinfe/semi-foundation/lib/es/dropdown/constants'; import cls from 'classnames'; import DropdownContext from './context'; const prefixCls = cssClasses.PREFIX; class DropdownTitle extends PureComponent { render() { const { className, style, children } = this.props; const { showTick } = this.context; const titleCls = cls({ [`${prefixCls}-title`]: true, [`${prefixCls}-title-withTick`]: showTick }, className); return /*#__PURE__*/React.createElement("div", { className: titleCls, style: style }, children); } } DropdownTitle.propTypes = { children: PropTypes.node, className: PropTypes.string, style: PropTypes.object }; DropdownTitle.contextType = DropdownContext; export default DropdownTitle;