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
33 lines (31 loc) · 959 Bytes
/
index.tsx
File metadata and controls
33 lines (31 loc) · 959 Bytes
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
import * as React from 'react'
import { connect, Connect } from '../../app'
import { getAppShortName, nameToColor } from '../../app/utils'
import { Wrapper, App, CurrentApp, Overlay, AppsList } from './elements'
const Apps: React.SFC<Connect> = ({ app }) => (
<Wrapper>
<CurrentApp
color={nameToColor(app.state.currentAppName)}
onClick={app.actions.toggleShowApps}
>
{getAppShortName(app.state.currentAppName)}
</CurrentApp>
{app.state.showApps ? (
<>
<Overlay onClick={app.actions.toggleShowApps} />
<AppsList>
{Object.keys(app.state.apps).map((appName) => (
<App
key={appName}
onClick={() => app.actions.selectApp(appName)}
isSelected={app.state.currentAppName === appName}
>
{appName}
</App>
))}
</AppsList>
</>
) : null}
</Wrapper>
)
export default connect(Apps)