-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathNavs.js
87 lines (83 loc) · 2.15 KB
/
Navs.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import React from "react";
import classnames from "classnames";
// reactstrap components
import {
Card,
CardBody,
NavItem,
NavLink,
Nav,
TabContent,
TabPane
} from "reactstrap";
class Navs extends React.Component {
state = {
tabs: 1
};
toggleNavs = (e, state, index) => {
e.preventDefault();
this.setState({
[state]: index
});
};
render() {
return (
<>
<div className="nav-wrapper">
<Nav
className="nav-fill flex-column flex-md-row"
id="tabs-icons-text"
pills
role="tablist"
>
<NavItem>
<NavLink
aria-selected={this.state.tabs === 1}
className={classnames("mb-sm-3 mb-md-0 mx-0 px-0", {
active: this.state.tabs === 1
})}
onClick={e => this.toggleNavs(e, "tabs", 1)}
href="#"
role="tab"
>
<i className="ni ni-bullet-list-67 mr-2" />
Details
</NavLink>
</NavItem>
<NavItem>
<NavLink
aria-selected={this.state.tabs === 2}
className={classnames("mb-sm-3 mb-md-0 mx-0 px-0", {
active: this.state.tabs === 2
})}
onClick={e => this.toggleNavs(e, "tabs", 2)}
href="#"
role="tab"
>
<i className="ni ni-bell-55 mr-2" />
About
</NavLink>
</NavItem>
</Nav>
</div>
<Card className="shadow">
<CardBody>
<TabContent activeTab={"tabs" + this.state.tabs}>
<TabPane tabId="tabs1">
<p className="Details text-black">
{this.props.data.Details}
</p>
</TabPane>
<TabPane tabId="tabs2">
<p className="About">
{this.props.data.About}
</p>
</TabPane>
</TabContent>
</CardBody>
</Card>
</>
);
}
}
export default Navs;