aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/containers/WorkspacesScreen.js
blob: f129edec5673bb5370d979f0a09da8997334e674 (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 '../state';
import WorkspacesDashboard from '../components/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;