Bug 1212083 - Part 1. Remove the direct calls UI from Loop. r=mikedeboer
This commit is contained in:
@@ -75,6 +75,44 @@ loop.roomViews = (function(mozL10n) {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Used to display errors in direct calls and rooms to the user.
|
||||
*/
|
||||
var FailureInfoView = React.createClass({displayName: "FailureInfoView",
|
||||
propTypes: {
|
||||
failureReason: React.PropTypes.string.isRequired
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the translated message appropraite to the failure reason.
|
||||
*
|
||||
* @return {String} The translated message for the failure reason.
|
||||
*/
|
||||
_getMessage: function() {
|
||||
switch (this.props.failureReason) {
|
||||
case FAILURE_DETAILS.NO_MEDIA:
|
||||
case FAILURE_DETAILS.UNABLE_TO_PUBLISH_MEDIA:
|
||||
return mozL10n.get("no_media_failure_message");
|
||||
case FAILURE_DETAILS.TOS_FAILURE:
|
||||
return mozL10n.get("tos_failure_message",
|
||||
{ clientShortname: mozL10n.get("clientShortname2") });
|
||||
case FAILURE_DETAILS.ICE_FAILED:
|
||||
return mozL10n.get("ice_failure_message");
|
||||
default:
|
||||
return mozL10n.get("generic_failure_message");
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
React.createElement("div", {className: "failure-info"},
|
||||
React.createElement("div", {className: "failure-info-logo"}),
|
||||
React.createElement("h2", {className: "failure-info-message"}, this._getMessage())
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Something went wrong view. Displayed when there's a big problem.
|
||||
*/
|
||||
@@ -110,8 +148,7 @@ loop.roomViews = (function(mozL10n) {
|
||||
|
||||
return (
|
||||
React.createElement("div", {className: "room-failure"},
|
||||
React.createElement(loop.conversationViews.FailureInfoView, {
|
||||
failureReason: this.props.failureReason}),
|
||||
React.createElement(FailureInfoView, {failureReason: this.props.failureReason}),
|
||||
React.createElement("div", {className: "btn-group call-action-group"},
|
||||
React.createElement("button", {className: "btn btn-info btn-rejoin",
|
||||
onClick: this.handleRejoinCall},
|
||||
@@ -820,6 +857,7 @@ loop.roomViews = (function(mozL10n) {
|
||||
|
||||
return {
|
||||
ActiveRoomStoreMixin: ActiveRoomStoreMixin,
|
||||
FailureInfoView: FailureInfoView,
|
||||
RoomFailureView: RoomFailureView,
|
||||
SocialShareDropdown: SocialShareDropdown,
|
||||
DesktopRoomEditContextView: DesktopRoomEditContextView,
|
||||
|
||||
Reference in New Issue
Block a user