diff options
author | Dominik Guzei <dominik.guzei@gmail.com> | 2019-01-14 19:01:46 +0100 |
---|---|---|
committer | Dominik Guzei <dominik.guzei@gmail.com> | 2019-02-12 13:39:05 +0100 |
commit | e6da59b728bf44342428531a2c7e4024829234ed (patch) | |
tree | c00dea3ae961dcee4110df52b5f842211ed50ba3 /src/containers/settings/EditWorkspaceScreen.js | |
parent | add styles for workspace table (diff) | |
download | ferdium-app-e6da59b728bf44342428531a2c7e4024829234ed.tar.gz ferdium-app-e6da59b728bf44342428531a2c7e4024829234ed.tar.zst ferdium-app-e6da59b728bf44342428531a2c7e4024829234ed.zip |
setup logic to display workspace edit page
Diffstat (limited to 'src/containers/settings/EditWorkspaceScreen.js')
-rw-r--r-- | src/containers/settings/EditWorkspaceScreen.js | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/containers/settings/EditWorkspaceScreen.js b/src/containers/settings/EditWorkspaceScreen.js new file mode 100644 index 000000000..665b405bd --- /dev/null +++ b/src/containers/settings/EditWorkspaceScreen.js | |||
@@ -0,0 +1,54 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import { inject, observer } from 'mobx-react'; | ||
3 | import { defineMessages, intlShape } from 'react-intl'; | ||
4 | import Form from '../../lib/Form'; | ||
5 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | ||
6 | import { gaPage } from '../../lib/analytics'; | ||
7 | import { state } from '../../features/workspaces/state'; | ||
8 | |||
9 | const messages = defineMessages({ | ||
10 | name: { | ||
11 | id: 'settings.workspace.form.name', | ||
12 | defaultMessage: '!!!Name', | ||
13 | }, | ||
14 | }); | ||
15 | |||
16 | @inject('stores', 'actions') @observer | ||
17 | class EditWorkspaceScreen extends Component { | ||
18 | static contextTypes = { | ||
19 | intl: intlShape, | ||
20 | }; | ||
21 | |||
22 | componentDidMount() { | ||
23 | gaPage('Settings/Workspace/Edit'); | ||
24 | } | ||
25 | |||
26 | prepareForm(workspace) { | ||
27 | const { intl } = this.context; | ||
28 | const config = { | ||
29 | fields: { | ||
30 | name: { | ||
31 | label: intl.formatMessage(messages.name), | ||
32 | placeholder: intl.formatMessage(messages.name), | ||
33 | value: workspace.name, | ||
34 | }, | ||
35 | }, | ||
36 | }; | ||
37 | return new Form(config); | ||
38 | } | ||
39 | |||
40 | render() { | ||
41 | const { workspaceBeingEdited } = state; | ||
42 | if (!workspaceBeingEdited) return null; | ||
43 | |||
44 | // const form = this.prepareForm(workspaceBeingEdited); | ||
45 | |||
46 | return ( | ||
47 | <ErrorBoundary> | ||
48 | <div>{workspaceBeingEdited.name}</div> | ||
49 | </ErrorBoundary> | ||
50 | ); | ||
51 | } | ||
52 | } | ||
53 | |||
54 | export default EditWorkspaceScreen; | ||