Make CreateRoom remember what the values of its fields were. Remove some fairly pointless atoms

This commit is contained in:
Erik Johnston 2015-07-16 17:20:03 +01:00
parent 47f4c0dfff
commit aa1b763518
10 changed files with 55 additions and 203 deletions

View file

@ -25,7 +25,7 @@ module.exports = React.createClass({
mixins: [RoomAliasController],
onValueChanged: function(ev) {
this.setState({room_alias: ev.target.value})
this.props.onChange(ev.target.value);
},
onFocus: function(ev) {
@ -72,7 +72,8 @@ module.exports = React.createClass({
render: function() {
return (
<input type="text" className="mx_RoomAlias" placeholder="Alias (optional)"
onChange={this.onValueChanged} onFocus={this.onFocus} onBlur={this.onBlur}/>
onChange={this.onValueChanged} onFocus={this.onFocus} onBlur={this.onBlur}
value={this.props.alias}/>
);
}
});

View file

@ -1,36 +0,0 @@
/*
Copyright 2015 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
'use strict';
var React = require('react');
var RoomNameTextboxController = require("../../../../../src/controllers/atoms/create_room/RoomNameTextbox");
module.exports = React.createClass({
displayName: 'RoomNameTextbox',
mixins: [RoomNameTextboxController],
onValueChanged: function(ev) {
this.setState({room_name: ev.target.value})
},
render: function() {
return (
<input type="text" className="mx_RoomNameTextbox" placeholder="Name" onChange={this.onValueChanged}/>
);
}
});

View file

@ -1,37 +0,0 @@
/*
Copyright 2015 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
'use strict';
var React = require('react');
var RoomTopicController = require("../../../../../src/controllers/atoms/create_room/RoomTopic");
module.exports = React.createClass({
displayName: 'RoomTopic',
mixins: [RoomTopicController],
onValueChanged: function(ev) {
this.setState({room_topic: ev.target.value})
},
render: function() {
return (
<textarea className="mx_RoomTopic" placeholder="Description" onChange={this.onValueChanged}>
</textarea>
);
}
});