2015-07-14 17:14:26 +03:00
|
|
|
/*
|
2016-01-07 07:06:39 +03:00
|
|
|
Copyright 2015, 2016 OpenMarket Ltd
|
2015-07-14 17:14:26 +03:00
|
|
|
|
|
|
|
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';
|
|
|
|
|
2017-10-11 19:56:17 +03:00
|
|
|
const React = require('react');
|
2017-06-08 11:44:58 +03:00
|
|
|
import { _t } from '../../../languageHandler';
|
2015-07-14 17:14:26 +03:00
|
|
|
|
2017-10-11 19:56:17 +03:00
|
|
|
const Presets = {
|
2015-09-16 18:10:39 +03:00
|
|
|
PrivateChat: "private_chat",
|
|
|
|
PublicChat: "public_chat",
|
|
|
|
Custom: "custom",
|
|
|
|
};
|
|
|
|
|
2015-11-26 18:44:42 +03:00
|
|
|
module.exports = React.createClass({
|
|
|
|
displayName: 'CreateRoomPresets',
|
2015-07-14 17:14:26 +03:00
|
|
|
propTypes: {
|
2015-09-16 18:10:39 +03:00
|
|
|
onChange: React.PropTypes.func,
|
2017-10-11 19:56:17 +03:00
|
|
|
preset: React.PropTypes.string,
|
2015-07-14 17:14:26 +03:00
|
|
|
},
|
|
|
|
|
2015-09-16 18:10:39 +03:00
|
|
|
Presets: Presets,
|
|
|
|
|
2015-07-14 17:14:26 +03:00
|
|
|
getDefaultProps: function() {
|
|
|
|
return {
|
2015-09-16 18:10:39 +03:00
|
|
|
onChange: function() {},
|
2015-07-14 17:14:26 +03:00
|
|
|
};
|
|
|
|
},
|
2015-11-26 18:44:42 +03:00
|
|
|
|
|
|
|
onValueChanged: function(ev) {
|
2017-01-20 17:22:27 +03:00
|
|
|
this.props.onChange(ev.target.value);
|
2015-11-26 18:44:42 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
render: function() {
|
|
|
|
return (
|
|
|
|
<select className="mx_Presets" onChange={this.onValueChanged} value={this.props.preset}>
|
2017-10-11 19:56:17 +03:00
|
|
|
<option value={this.Presets.PrivateChat}>{ _t("Private Chat") }</option>
|
|
|
|
<option value={this.Presets.PublicChat}>{ _t("Public Chat") }</option>
|
|
|
|
<option value={this.Presets.Custom}>{ _t("Custom") }</option>
|
2015-11-26 18:44:42 +03:00
|
|
|
</select>
|
|
|
|
);
|
2017-10-11 19:56:17 +03:00
|
|
|
},
|
2015-11-26 18:44:42 +03:00
|
|
|
});
|