UNPKG

776 BJavaScriptView Raw
1import React from 'react';
2import PropTypes from 'prop-types';
3import classNames from 'classnames';
4import { mapToCssModules, tagPropType } from './utils';
5
6const propTypes = {
7 /** Add custom class */
8 className: PropTypes.string,
9 /** Change underlying component's CSS base class name */
10 cssModule: PropTypes.object,
11 /** Set a custom element for this component */
12 tag: tagPropType,
13 active: PropTypes.bool,
14};
15
16function NavbarText(props) {
17 const {
18 className,
19 cssModule,
20 active,
21 tag: Tag = 'span',
22 ...attributes
23 } = props;
24
25 const classes = mapToCssModules(
26 classNames(className, 'navbar-text'),
27 cssModule,
28 );
29
30 return <Tag {...attributes} className={classes} />;
31}
32
33NavbarText.propTypes = propTypes;
34
35export default NavbarText;
36
\No newline at end of file