UNPKG

wix-style-react

Version:
27 lines 1.45 kB
import React from 'react'; import PropTypes from 'prop-types'; import { st, classes } from './SidebarDividerNext.st.css'; import Divider from '../Divider'; import { SidebarNextContext } from '../SidebarNext/SidebarNextContext'; import { skins } from './constants'; import { WixStyleReactContext } from '../WixStyleReactProvider/context'; /** A divider within the sidebar that supports inner and full mode */ class SidebarDividerNext extends React.PureComponent { render() { const { dataHook, fullWidth } = this.props; return (React.createElement(WixStyleReactContext.Consumer, null, () => (React.createElement(SidebarNextContext.Consumer, null, context => { const skin = (context && context.skin) || skins.dark; return (React.createElement("div", { "data-hook": dataHook, "data-skin": skin, "data-full-width": fullWidth, className: st(classes.root, fullWidth ? classes.fullWidth : ''), "aria-hidden": "true" }, React.createElement(Divider, { className: st(classes.divider, { skin }) }))); })))); } } SidebarDividerNext.displayName = 'SidebarDividerNext'; SidebarDividerNext.propTypes = { /** Applied as data-hook HTML attribute that can be used in the tests */ dataHook: PropTypes.string, /** Indicates whether to remove the margin from sides */ fullWidth: PropTypes.bool, }; export default SidebarDividerNext; //# sourceMappingURL=SidebarDividerNext.js.map