mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 06:35:42 +00:00
Bug 1077332: hide tabs when not logged in with FxA. r=paolo
This commit is contained in:
parent
0ae54b5649
commit
525397604c
@ -55,7 +55,9 @@ loop.panel = (function(_, mozL10n) {
|
||||
}, this);
|
||||
return (
|
||||
React.DOM.div({className: "tab-view-container"},
|
||||
React.DOM.ul({className: "tab-view"}, tabButtons),
|
||||
!this.props.buttonsHidden
|
||||
? React.DOM.ul({className: "tab-view"}, tabButtons)
|
||||
: null,
|
||||
tabs
|
||||
)
|
||||
);
|
||||
@ -479,7 +481,12 @@ loop.panel = (function(_, mozL10n) {
|
||||
},
|
||||
|
||||
_onStatusChanged: function() {
|
||||
this.setState({userProfile: navigator.mozLoop.userProfile});
|
||||
var profile = navigator.mozLoop.userProfile;
|
||||
if (profile != this.state.userProfile) {
|
||||
// On profile change (login, logout), switch back to the default tab.
|
||||
this.selectTab("call");
|
||||
}
|
||||
this.setState({userProfile: profile});
|
||||
this.updateServiceErrors();
|
||||
},
|
||||
|
||||
@ -512,7 +519,7 @@ loop.panel = (function(_, mozL10n) {
|
||||
React.DOM.div(null,
|
||||
NotificationListView({notifications: this.props.notifications,
|
||||
clearOnDocumentHidden: true}),
|
||||
TabView({ref: "tabView"},
|
||||
TabView({ref: "tabView", buttonsHidden: !this.state.userProfile},
|
||||
Tab({name: "call"},
|
||||
React.DOM.div({className: "content-area"},
|
||||
CallUrlResult({client: this.props.client,
|
||||
|
@ -55,7 +55,9 @@ loop.panel = (function(_, mozL10n) {
|
||||
}, this);
|
||||
return (
|
||||
<div className="tab-view-container">
|
||||
<ul className="tab-view">{tabButtons}</ul>
|
||||
{!this.props.buttonsHidden
|
||||
? <ul className="tab-view">{tabButtons}</ul>
|
||||
: null}
|
||||
{tabs}
|
||||
</div>
|
||||
);
|
||||
@ -479,7 +481,12 @@ loop.panel = (function(_, mozL10n) {
|
||||
},
|
||||
|
||||
_onStatusChanged: function() {
|
||||
this.setState({userProfile: navigator.mozLoop.userProfile});
|
||||
var profile = navigator.mozLoop.userProfile;
|
||||
if (profile != this.state.userProfile) {
|
||||
// On profile change (login, logout), switch back to the default tab.
|
||||
this.selectTab("call");
|
||||
}
|
||||
this.setState({userProfile: profile});
|
||||
this.updateServiceErrors();
|
||||
},
|
||||
|
||||
@ -512,7 +519,7 @@ loop.panel = (function(_, mozL10n) {
|
||||
<div>
|
||||
<NotificationListView notifications={this.props.notifications}
|
||||
clearOnDocumentHidden={true} />
|
||||
<TabView ref="tabView">
|
||||
<TabView ref="tabView" buttonsHidden={!this.state.userProfile}>
|
||||
<Tab name="call">
|
||||
<div className="content-area">
|
||||
<CallUrlResult client={this.props.client}
|
||||
|
Loading…
Reference in New Issue
Block a user