-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
59 lines (53 loc) · 1.17 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import React from 'react';
const CLS = {
top: 'navbar fixed top horizontal',
right: 'navbar fixed right vertical',
bottom: 'navbar fixed bottom horizontal',
left: 'navbar fixed left vertical',
};
export default class Navbar extends React.Component {
render() {
const { vertical, fixed, dark } = this.props;
if (fixed) {
var cls = CLS[fixed]
} else {
cls = 'navbar' + (vertical ? ' vertical': ' horizontal');
}
if (dark) { cls += ' dark'; }
return (
<div className={cls}>{this.props.children}</div>
);
}
}
class Brand extends React.Component {
render() {
return (
<ul className="brand">
<li>{this.props.children}</li>
</ul>
);
}
}
class Item extends React.Component {
render() {
var cls = "item";
if (this.props.active) { cls += ' active'; }
return (
<li className={cls}>{this.props.children}</li>
);
}
}
class Nav extends React.Component {
render() {
var cls = 'nav';
if (this.props.second) { cls += ' second'; }
return (
<ul className={cls}>
{this.props.children}
</ul>
);
}
}
Navbar.Brand = Brand;
Navbar.Item = Item;
Navbar.Nav = Nav;