mirror of https://github.com/vector-im/riot-web
32 lines
756 B
JavaScript
32 lines
756 B
JavaScript
var React = require('react');
|
|
|
|
var MatrixClientPeg = require("../MatrixClientPeg.js");
|
|
|
|
module.exports = React.createClass({
|
|
getDefaultProps: function() {
|
|
return {
|
|
default_url: 'https://matrix.org/'
|
|
};
|
|
},
|
|
|
|
getInitialState: function() {
|
|
return {
|
|
hs_url: this.props.default_url
|
|
}
|
|
},
|
|
|
|
hsChanged: function(ev) {
|
|
this.state.hs_url = ev.target.value;
|
|
MatrixClientPeg.replaceUsingUrl(this.state.hs_url);
|
|
},
|
|
|
|
render: function() {
|
|
return (
|
|
<div className="HomeServerTextBox">
|
|
Home Server URL:
|
|
<input type="text" value={this.state.hs_url} onChange={this.hsChanged} />
|
|
</div>
|
|
);
|
|
}
|
|
});
|