From 2307b3ca6ab69eeff7a2145b392dcfbfad00982d Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Wed, 24 May 2017 23:59:51 +0900 Subject: [PATCH] Fix alignment for 'Add new server' button --- src/browser/components/MainPage.jsx | 3 -- src/browser/components/TabBar.jsx | 45 +++++++++++---------------- src/browser/css/components/TabBar.css | 42 ++++++------------------- test/specs/browser/index_test.js | 2 +- 4 files changed, 30 insertions(+), 62 deletions(-) diff --git a/src/browser/components/MainPage.jsx b/src/browser/components/MainPage.jsx index b21bb2fb..9fa6ae70 100644 --- a/src/browser/components/MainPage.jsx +++ b/src/browser/components/MainPage.jsx @@ -111,9 +111,6 @@ const MainPage = createReactClass({ } }, handleSelect(key) { - if (key === 'addServerButton') { - return; - } const newKey = (this.props.teams.length + key) % this.props.teams.length; this.setState({ key: newKey diff --git a/src/browser/components/TabBar.jsx b/src/browser/components/TabBar.jsx index 87f6be29..83b371e1 100644 --- a/src/browser/components/TabBar.jsx +++ b/src/browser/components/TabBar.jsx @@ -1,29 +1,6 @@ const React = require('react'); const PropTypes = require('prop-types'); -const {Nav, NavItem, Button} = require('react-bootstrap'); - -function AddServerButton(props) { - return ( - - - - ); -} - -AddServerButton.propTypes = { - onClick: PropTypes.func -}; +const {Glyphicon, Nav, NavItem} = require('react-bootstrap'); function TabBar(props) { const tabs = props.teams.map((team, index) => { @@ -76,16 +53,32 @@ function TabBar(props) { { badgeDiv } ); }); + tabs.push( + + + + ); return ( ); } diff --git a/src/browser/css/components/TabBar.css b/src/browser/css/components/TabBar.css index ac967a7b..47b15445 100644 --- a/src/browser/css/components/TabBar.css +++ b/src/browser/css/components/TabBar.css @@ -10,13 +10,18 @@ padding: 0 15px; } -.TabBar .AddServerButton>a { +.TabBar .TabBar-addServerButton>a { border: none; background: transparent; - margin: 0px; - margin-left: 1px; /*Has no border and would be placed above the last item's border due to it's margin-right: -1px */ - padding: 0; - margin-bottom: 1px; + color: #999; + font-size: 10px; + line-height: 31px; +} + +.TabBar .TabBar-addServerButton>a:hover { + color: #333; + background-color: #e6e6e6; + border-color: #adadad; } .TabBar .TabBar-badge { @@ -32,30 +37,3 @@ margin-top: 5px; border-radius: 50%; }; - - -.TabBar .AddServerButton-button { - background-color: #fff; - border-color: #ccc; - color: #333; - margin-top: 3px; -} - -.TabBar .AddServerButton-button { - border: none; - font-size: 20px; - height: 31px; - padding: 2px 0 0 0; - width: 40px; - color: #999; - font-weight: bold; - margin: 0; - border-radius: 2px 2px 0 0; - outline: none; -} - -.TabBar .AddServerButton-button:hover { - color: #333; - background-color: #e6e6e6; - border-color: #adadad; -} diff --git a/test/specs/browser/index_test.js b/test/specs/browser/index_test.js index 6d760d57..7483b329 100644 --- a/test/specs/browser/index_test.js +++ b/test/specs/browser/index_test.js @@ -185,7 +185,7 @@ describe('browser/index.html', function desc() { it('should open the new server prompt after clicking the add button', () => { // See settings_test for specs that cover the actual prompt return this.app.client.waitUntilWindowLoaded(). - click('#tabBarAddNewTeam'). + click('#addServerButton'). pause(500). isExisting('#newServerModal').then((existing) => existing.should.be.true); });