forked from cerebral/overmind
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
76 lines (73 loc) · 2.03 KB
/
index.tsx
File metadata and controls
76 lines (73 loc) · 2.03 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
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
import { createElement, SFC } from 'react'
import { useOvermind } from '../../overmind'
import Apps from '../Apps'
import * as styles from './styles'
import Icon from '../common/Icon'
import { Tab } from '../../overmind/types'
import Tooltip from '../common/Tooltip'
import { css } from 'emotion'
const Tabs: SFC = () => {
const { state, actions } = useOvermind()
return (
<div className={styles.wrapper}>
<Apps />
<div className={styles.divider} />
<Tooltip text="State">
<button
className={css(
styles.button,
state.currentTab === Tab.State && styles.activeButton
)}
onClick={() => actions.changeTab(Tab.State)}
>
<Icon>database</Icon>
</button>
</Tooltip>
<Tooltip text="Actions">
<button
className={css(
styles.button,
state.currentTab === Tab.Actions && styles.activeButton
)}
onClick={() => actions.changeTab(Tab.Actions)}
>
<Icon>cogs</Icon>
</button>
</Tooltip>
<Tooltip text="Components">
<button
className={css(
styles.button,
state.currentTab === Tab.Components && styles.activeButton
)}
onClick={() => actions.changeTab(Tab.Components)}
>
<Icon>code</Icon>
</button>
</Tooltip>
<Tooltip text="Flushes">
<button
className={css(
styles.button,
state.currentTab === Tab.Flushes && styles.activeButton
)}
onClick={() => actions.changeTab(Tab.Flushes)}
>
<Icon>save</Icon>
</button>
</Tooltip>
<Tooltip text="Console">
<button
className={css(
styles.button,
state.currentTab === Tab.Console && styles.activeButton
)}
onClick={() => actions.changeTab(Tab.Console)}
>
<Icon>terminal</Icon>
</button>
</Tooltip>
</div>
)
}
export default Tabs