File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import React , { PropTypes } from 'react' ;
2+ import classNames from 'classnames' ;
3+
4+ const propTypes = { } ;
5+
6+ const defaultProps = { } ;
7+
8+ class PopoverContent extends React . Component {
9+ constructor ( props ) {
10+ super ( props ) ;
11+ }
12+
13+ render ( ) {
14+ const {
15+ children,
16+ className,
17+ ...attributes
18+ } = this . props ;
19+
20+ const classes = classNames (
21+ className ,
22+ 'popover-content'
23+ ) ;
24+
25+ return (
26+ < div { ...attributes }
27+ className = { classes } >
28+ { children }
29+ </ div >
30+ ) ;
31+ }
32+ }
33+
34+ PopoverContent . propTypes = propTypes ;
35+ PopoverContent . defaultProps = defaultProps ;
36+
37+ export default PopoverContent ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import DropdownMenu from './DropdownMenu';
88import DropdownToggle from './DropdownToggle' ;
99import Label from './Label' ;
1010import PopoverTitle from './PopoverTitle' ;
11+ import PopoverContent from './PopoverContent' ;
1112import TetherContent from './TetherContent' ;
1213import Tooltip from './Tooltip' ;
1314
@@ -21,6 +22,7 @@ export {
2122 DropdownMenu ,
2223 DropdownToggle ,
2324 Label ,
25+ PopoverContent ,
2426 PopoverTitle ,
2527 TetherContent ,
2628 Tooltip
Original file line number Diff line number Diff line change 1+ /* eslint react/no-multi-comp: 0, react/prop-types: 0 */
2+ import React from 'react' ;
3+ import { shallow , mount } from 'enzyme' ;
4+ import { PopoverContent } from '../lib' ;
5+
6+ describe ( 'PopoverContent' , ( ) => {
7+ it ( 'should render children' , ( ) => {
8+ const wrapper = shallow ( < PopoverContent > Ello world</ PopoverContent > ) ;
9+
10+ expect ( wrapper . text ( ) ) . toBe ( 'Ello world' ) ;
11+ expect ( wrapper . hasClass ( 'popover-content' ) ) . toBe ( true ) ;
12+ } ) ;
13+ } ) ;
You can’t perform that action at this time.
0 commit comments