diff options
Diffstat (limited to 'src/features/workspaces/containers/WorkspacesScreen.js')
-rw-r--r-- | src/features/workspaces/containers/WorkspacesScreen.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/features/workspaces/containers/WorkspacesScreen.js b/src/features/workspaces/containers/WorkspacesScreen.js new file mode 100644 index 000000000..2ab565fa1 --- /dev/null +++ b/src/features/workspaces/containers/WorkspacesScreen.js | |||
@@ -0,0 +1,42 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import { inject, observer } from 'mobx-react'; | ||
3 | import PropTypes from 'prop-types'; | ||
4 | import WorkspacesDashboard from '../components/WorkspacesDashboard'; | ||
5 | import ErrorBoundary from '../../../components/util/ErrorBoundary'; | ||
6 | import { workspaceStore } from '../index'; | ||
7 | import { | ||
8 | createWorkspaceRequest, | ||
9 | deleteWorkspaceRequest, | ||
10 | getUserWorkspacesRequest, | ||
11 | updateWorkspaceRequest, | ||
12 | } from '../api'; | ||
13 | |||
14 | @inject('actions') @observer | ||
15 | class WorkspacesScreen extends Component { | ||
16 | static propTypes = { | ||
17 | actions: PropTypes.shape({ | ||
18 | workspace: PropTypes.shape({ | ||
19 | edit: PropTypes.func.isRequired, | ||
20 | }), | ||
21 | }).isRequired, | ||
22 | }; | ||
23 | |||
24 | render() { | ||
25 | const { actions } = this.props; | ||
26 | return ( | ||
27 | <ErrorBoundary> | ||
28 | <WorkspacesDashboard | ||
29 | workspaces={workspaceStore.workspaces} | ||
30 | getUserWorkspacesRequest={getUserWorkspacesRequest} | ||
31 | createWorkspaceRequest={createWorkspaceRequest} | ||
32 | deleteWorkspaceRequest={deleteWorkspaceRequest} | ||
33 | updateWorkspaceRequest={updateWorkspaceRequest} | ||
34 | onCreateWorkspaceSubmit={data => actions.workspaces.create(data)} | ||
35 | onWorkspaceClick={w => actions.workspaces.edit({ workspace: w })} | ||
36 | /> | ||
37 | </ErrorBoundary> | ||
38 | ); | ||
39 | } | ||
40 | } | ||
41 | |||
42 | export default WorkspacesScreen; | ||