- {
- pre
- ?
{pre}
- : null
- }
- {
- title
- ? (
-
-
{ title }
- {
- subtitle
- ?
{subtitle}
- : null
- }
-
- )
- : subtitle &&
{subtitle}
- }
-
- {
- left
- ?
{ left }
- : ''
- }
- {
- right
- ?
{ right }
- : ''
- }
-
+function NavBar({
+ align = 'center',
+ children,
+ left,
+ right,
+ title,
+ pre,
+ subtitle,
+ withTabs,
+}) {
+ const subtitleContent = subtitle ?
{ subtitle }
: null;
+ return (
+
+
+ {pre && (
+
{pre}
+ )}
+ {
+ title
+ ? (
+
+
{ title }
+ { subtitleContent }
+
+ )
+ : subtitleContent
+ }
+
+ {left && (
+
{ left }
+ )}
+ {right && (
+
{ right }
+ )}
- { children }
-
- );
- }
+
+ { children }
+
+ );
}
+
+NavBar.propTypes = {
+ align: PropTypes.string,
+ children: PropTypes.oneOfType([
+ PropTypes.arrayOf(PropTypes.node),
+ PropTypes.node,
+ PropTypes.element,
+ PropTypes.string,
+ ]),
+ title: PropTypes.string,
+ subtitle: PropTypes.string,
+ pre: PropTypes.oneOfType([
+ PropTypes.element,
+ PropTypes.node,
+ ]),
+ left: PropTypes.oneOfType([
+ PropTypes.element,
+ PropTypes.node,
+ ]),
+ right: PropTypes.oneOfType([
+ PropTypes.element,
+ PropTypes.node,
+ ]),
+ withTabs: PropTypes.bool,
+};
+
+export default NavBar;