/** @jsx React.DOM */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ /* jshint newcap:false */ /* global loop:true, React */ var loop = loop || {}; loop.roomViews = (function(mozL10n) { "use strict"; var ROOM_STATES = loop.store.ROOM_STATES; var sharedViews = loop.shared.views; function noop() {} /** * ActiveRoomStore mixin. * @type {Object} */ var ActiveRoomStoreMixin = { mixins: [Backbone.Events], propTypes: { roomStore: React.PropTypes.instanceOf(loop.store.RoomStore).isRequired }, componentWillMount: function() { this.listenTo(this.props.roomStore, "change:activeRoom", this._onActiveRoomStateChanged); }, componentWillUnmount: function() { this.stopListening(this.props.roomStore); }, _onActiveRoomStateChanged: function() { this.setState(this.props.roomStore.getStoreState("activeRoom")); }, getInitialState: function() { var storeState = this.props.roomStore.getStoreState("activeRoom"); return _.extend(storeState, { // Used by the UI showcase. roomState: this.props.roomState || storeState.roomState }); } }; /** * Desktop room invitation view (overlay). */ var DesktopRoomInvitationView = React.createClass({ mixins: [ActiveRoomStoreMixin], propTypes: { dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired }, handleFormSubmit: function(event) { event.preventDefault(); // XXX }, handleEmailButtonClick: function(event) { event.preventDefault(); // XXX }, handleCopyButtonClick: function(event) { event.preventDefault(); // XXX }, render: function() { return (
{mozL10n.get("invite_header_text")}