diff --git a/pkg/interface/src/views/apps/chat/components/settings.js b/pkg/interface/src/views/apps/chat/components/settings.js index cdb22f5b5..c450b9e79 100644 --- a/pkg/interface/src/views/apps/chat/components/settings.js +++ b/pkg/interface/src/views/apps/chat/components/settings.js @@ -93,7 +93,7 @@ export class SettingsScreen extends Component { association={association} resource="chat" app="chat" - station={station} /> + /> { - this.setState({ disabled: false }); - }); - } - } + changeLoading(isLoading, awaiting, type, closure) { + this.setState({ + isLoading, + awaiting, + type + }, closure); } removeCollection() { @@ -115,7 +50,7 @@ export class SettingsScreen extends Component { this.setState({ isLoading: true, - disabled: true, + awaiting: true, type: 'Removing' }); props.api.links.removeCollection(props.resourcePath) @@ -131,7 +66,7 @@ export class SettingsScreen extends Component { this.setState({ isLoading: true, - disabled: true, + awaiting: true, type: 'Deleting' }); props.api.links.deleteCollection(props.resourcePath) @@ -175,7 +110,7 @@ export class SettingsScreen extends Component { Delete this collection, for you and all group members.

Delete collection @@ -184,105 +119,6 @@ export class SettingsScreen extends Component { } } - renderMetadataSettings() { - const { props, state } = this; - const { resource } = props; - - if (!('metadata' in resource)) { - resource.metadata = {}; - } - - return( -
-
-

Rename

-

Change the name of this collection

-
- { - if (props.amOwner) { - this.setState({ disabled: true }); - props.api.metadata.metadataAdd( - 'link', - props.resourcePath, - props.groupPath, - state.title, - resource.metadata.description, - resource.metadata['date-created'], - uxToHex(resource.metadata.color) - ).then(() => { - this.setState({ disabled: false }); - }); - } - }} - /> -
-

Change description

-

- Change the description of this collection -

-
- { - if (props.amOwner) { - this.setState({ disabled: true }); - props.api.metadata.metadataAdd( - 'link', - props.resourcePath, - props.groupPath, - resource.metadata.title, - state.description, - resource.metadata['date-created'], - uxToHex(resource.metadata.color) - ).then(() => { - this.setState({ disabled: false }); - }); - } - }} - /> -
-

Change color

-

Give this collection a color when viewing group channels

-
-
- -
-
-
- ); - } - render() { const { props, state } = this; @@ -367,11 +203,18 @@ export class SettingsScreen extends Component { {this.renderRemove()} {this.renderDelete()} - {this.renderMetadataSettings()} +
diff --git a/pkg/interface/src/views/components/metadata/settings.js b/pkg/interface/src/views/components/metadata/settings.js index d8b6adf32..86c64d66e 100644 --- a/pkg/interface/src/views/components/metadata/settings.js +++ b/pkg/interface/src/views/components/metadata/settings.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React from 'react'; import { MetadataColor } from './color'; import { MetadataInput } from './input'; @@ -53,7 +53,7 @@ export const MetadataSettings = (props) => { isDisabled={!isOwner} initialValue={description} setValue={(val) => { - changeLoading(false, true, 'Editing chat...', () => { + changeLoading(false, true, `Editing ${resource}...`, () => { api.metadata.metadataAdd( app, association['app-path'],