aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/settings/WorkspacesScreen.js
blob: 5e91f76737e5b9597f987bc2aa37db10194d89af (plain) (blame)
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
import React, { Component } from 'react';
import { inject, observer } from 'mobx-react';
import PropTypes from 'prop-types';
import { gaPage } from '../../lib/analytics';
import { state } from '../../features/workspaces/state';
import WorkspacesDashboard from '../../components/settings/workspaces/WorkspacesDashboard';
import ErrorBoundary from '../../components/util/ErrorBoundary';

@inject('actions') @observer
class WorkspacesScreen extends Component {
  static propTypes = {
    actions: PropTypes.shape({
      workspace: PropTypes.shape({
        edit: PropTypes.func.isRequired,
      }),
    }).isRequired,
  };

  componentDidMount() {
    gaPage('Settings/Workspaces Dashboard');
  }

  render() {
    const { workspace } = this.props.actions;
    return (
      <ErrorBoundary>
        <WorkspacesDashboard
          workspaces={state.workspaces}
          isLoading={state.isLoading}
          onWorkspaceClick={w => workspace.edit({ workspace: w })}
        />
      </ErrorBoundary>
    );
  }
}

export default WorkspacesScreen;