-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathindex.js
49 lines (44 loc) · 986 Bytes
/
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
import React, { Component } from 'react'
import States from './States'
import Variations from './Variations'
import Groups from './Groups'
import IconSearch from '../../../Components/IconSearch/IconSearch'
import { Menu } from 'src'
const tabs = [
'Icon Set',
'Examples',
]
class IconExamples extends Component {
state = { activeIndex: 0 }
handleMenuItemClick = (e, { index }) => this.setState({ activeIndex: index })
renderActiveTab = () => ({
0: (
<div>
<IconSearch />
</div>
),
1: (
<div>
<States />
<Variations />
<Groups />
</div>
),
})[this.state.activeIndex]
render() {
return (
<div>
<Menu
widths={2}
tabular
defaultActiveIndex={0}
items={tabs}
onItemClick={this.handleMenuItemClick}
style={{ marginBottom: 0 }}
/>
{this.renderActiveTab()}
</div>
)
}
}
export default IconExamples