-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.jsx
More file actions
47 lines (45 loc) · 1.39 KB
/
demo.jsx
File metadata and controls
47 lines (45 loc) · 1.39 KB
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
import React from 'react'
import Tabs from './index'
const TABS = [
'First',
'Second',
'Third'
]
const TABS_DYNAMIC = [
{ selectedLabel: '1st!', unselectedLabel: 'First' },
{ selectedLabel: '2nd!', unselectedLabel: 'Second' },
{ selectedLabel: '3rd!', unselectedLabel: 'Third' }
]
export default class TabsDemo extends React.Component {
constructor(props) {
super(props)
this.state = {
selected1: TABS[0],
selected2: TABS_DYNAMIC[0],
selected3: TABS[0]
}
}
render() {
return <div>
<h1>patchkit-tabs</h1>
<section className="tabs-horz">
<header><Tabs tabs="..."></header>
<div className="content">
<Tabs tabs={TABS} selected={this.state.selected1} onSelect={o=>this.setState({ selected1: o })} />
</div>
</section>
<section className="tabs-horz-dynamic-label">
<header><Tabs tabs="..."> (dynamic label)</header>
<div className="content">
<Tabs tabs={TABS_DYNAMIC} selected={this.state.selected2} onSelect={o=>this.setState({ selected2: o })} />
</div>
</section>
<section className="tabs-vert">
<header><Tabs tabs="..." vertical></header>
<div className="content">
<Tabs vertical tabs={TABS} selected={this.state.selected3} onSelect={o=>this.setState({ selected3: o })} />
</div>
</section>
</div>
}
}