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