diff --git a/src/browser/components/MainPage.jsx b/src/browser/components/MainPage.jsx index 60d906f5..34e7186e 100644 --- a/src/browser/components/MainPage.jsx +++ b/src/browser/components/MainPage.jsx @@ -24,7 +24,8 @@ const MainPage = createReactClass({ initialIndex: PropTypes.number.isRequired, useSpellChecker: PropTypes.bool.isRequired, onSelectSpellCheckerLocale: PropTypes.func.isRequired, - deeplinkingUrl: PropTypes.string + deeplinkingUrl: PropTypes.string, + showAddServerButton: PropTypes.bool.isRequired }, getInitialState() { @@ -258,6 +259,7 @@ const MainPage = createReactClass({ activeKey={this.state.key} onSelect={this.handleSelect} onAddServer={this.addServer} + showAddServerButton={this.props.showAddServerButton} /> ); diff --git a/src/browser/components/SettingsPage.jsx b/src/browser/components/SettingsPage.jsx index 708337fc..95d7c5b1 100644 --- a/src/browser/components/SettingsPage.jsx +++ b/src/browser/components/SettingsPage.jsx @@ -255,6 +255,41 @@ const SettingsPage = createReactClass({ }, render() { + const settingsPage = { + navbar: { + backgroundColor: '#fff' + }, + close: { + textDecoration: 'none', + position: 'absolute', + right: '0', + top: '5px', + fontSize: '35px', + fontWeight: 'normal', + color: '#bbb' + }, + heading: { + textAlign: 'center', + fontSize: '24px', + margin: '0', + padding: '1em 0' + }, + sectionHeading: { + fontSize: '20px', + margin: '0', + padding: '1em 0', + float: 'left' + }, + sectionHeadingLink: { + marginTop: '24px', + display: 'inline-block', + fontSize: '15px' + }, + footer: { + padding: '0.4em 0' + } + }; + var teamsRow = ( @@ -267,11 +302,53 @@ const SettingsPage = createReactClass({ updateTeam={this.updateTeam} addServer={this.addServer} onTeamClick={backToIndex} + allowTeamEdit={this.state.enableTeamModification} /> ); + var serversRow = ( + + +

{'Server Management'}

+
+ +
+ + +

+ {'⊞ Add new server'} +

+ +
+ ); + + var srvMgmt; + if (this.state.enableServerManagement || this.state.teams.length === 0) { + srvMgmt = ( +
+ {serversRow} + {teamsRow} +
+
+ ); + } + var options = []; // MacOS has an option in the Dock, to set the app to autostart, so we choose to not support this option for OSX @@ -404,41 +481,6 @@ const SettingsPage = createReactClass({ ); } - const settingsPage = { - navbar: { - backgroundColor: '#fff' - }, - close: { - textDecoration: 'none', - position: 'absolute', - right: '0', - top: '5px', - fontSize: '35px', - fontWeight: 'normal', - color: '#bbb' - }, - heading: { - textAlign: 'center', - fontSize: '24px', - margin: '0', - padding: '1em 0' - }, - sectionHeading: { - fontSize: '20px', - margin: '0', - padding: '1em 0', - float: 'left' - }, - sectionHeadingLink: { - marginTop: '24px', - display: 'inline-block', - fontSize: '15px' - }, - footer: { - padding: '0.4em 0' - } - }; - var optionsRow = (options.length > 0) ? ( @@ -482,35 +524,7 @@ const SettingsPage = createReactClass({ className='settingsPage' style={{paddingTop: '100px'}} > - - -

{'Server Management'}

-
- -
- - -

- {'⊞ Add new server'} -

- -
- { teamsRow } -
+ { srvMgmt } { optionsRow } diff --git a/src/browser/components/TabBar.jsx b/src/browser/components/TabBar.jsx index 32d9d6f8..6287b572 100644 --- a/src/browser/components/TabBar.jsx +++ b/src/browser/components/TabBar.jsx @@ -53,17 +53,19 @@ function TabBar(props) { { badgeDiv } ); }); - tabs.push( - - - - ); + if (props.showAddServerButton === true) { + tabs.push( + + + + ); + } return (