ackee-abibuch-common
Advanced tools
Comparing version 0.0.4 to 0.0.5
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import NavBar from '../NavBar'; | ||
import NavBar from '../NavBar/NavBar'; | ||
describe('NavBar', () => { | ||
it('should render title', () => { | ||
const wrapper = shallow(<NavBar />); | ||
expect(wrapper.type()).toBe('h1'); | ||
const wrapper = shallow(<NavBar title="Test title" />); | ||
expect(wrapper.type()).toBe('div'); | ||
}); | ||
@@ -11,0 +11,0 @@ |
@@ -7,21 +7,25 @@ import React from 'react'; | ||
<div className="NavBar"> | ||
{LeftComponent && | ||
<section className="NavBar-LeftComponent"> | ||
<LeftComponent /> | ||
</section> | ||
} | ||
<div className="NavBar-Left"> | ||
{LeftComponent && | ||
<section className="NavBar-Left-LeftComponent"> | ||
<LeftComponent /> | ||
</section> | ||
} | ||
<h2 className="NavBar-title">{title}</h2> | ||
<h2 className="NavBar-Left-title">{title}</h2> | ||
<section className="Menu"> | ||
{menuItems.map((menuItem, i) => | ||
<span key={'menuItem' + i} className="Menu-item">{menuItem}</span> | ||
)} | ||
</section> | ||
<section className="Menu"> | ||
{menuItems.map((menuItem, i) => | ||
<span key={'menuItem' + i} className="Menu-item">{menuItem}</span> | ||
)} | ||
</section> | ||
</div> | ||
{RightComponent && | ||
<section className="NavBar-RightComponent"> | ||
<RightComponent /> | ||
</section> | ||
} | ||
<div className="NavBar-Right"> | ||
{RightComponent && | ||
<section className="NavBar-Right-RightComponent"> | ||
<RightComponent /> | ||
</section> | ||
} | ||
</div> | ||
</div> | ||
@@ -33,4 +37,4 @@ ); | ||
menuItems: PropTypes.arrayOf(PropTypes.element), | ||
LeftComponent: PropTypes.element, | ||
RightComponent: PropTypes.element, | ||
LeftComponent: PropTypes.func, | ||
RightComponent: PropTypes.func, | ||
}; | ||
@@ -37,0 +41,0 @@ |
{ | ||
"name": "ackee-abibuch-common", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Set of tools for reuse in abibuch administration and editor", | ||
@@ -5,0 +5,0 @@ "main": "es/index.js", |
Sorry, the diff of this file is not supported yet
8470
16
90