Skip to content

Commit

Permalink
Merge pull request #222 from huridocs/215-menu
Browse files Browse the repository at this point in the history
LGTM
  • Loading branch information
txau committed Jul 26, 2016
2 parents d521582 + 6c6a157 commit b668f6f
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 26 deletions.
6 changes: 4 additions & 2 deletions app/react/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ class App extends Component {
render() {
let menuClass = 'col-md-5 col-sm-6';
let menuToggleClass = 'navbar-toggle ';
let MenuButtonClass = 'menu-button fa fa-bars';
let navClass = 'nav nav-pills col-sm-6 col-md-5';

if (this.state.showmenu) {
menuClass += ' in';
menuToggleClass += 'active';
MenuButtonClass = 'menu-button fa fa-close';
navClass += ' is-active';
}

Expand All @@ -78,10 +80,10 @@ class App extends Component {
<div className="row">
<h1 className="col-sm-2"><SiteName/></h1>
<div className="col-sm-4 col-md-5">
<i className="fa fa-bars" onClick={this.toggleMenu.bind(this)}></i>
<i className={MenuButtonClass} onClick={this.toggleMenu.bind(this)}></i>
{this.renderTools()}
</div>
<Menu className={navClass} />
<Menu onClick={this.toggleMenu.bind(this)} className={navClass} />
</div>
</div>
</header>
Expand Down
5 changes: 3 additions & 2 deletions app/react/App/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Menu extends Component {
render() {
const user = this.props.user.toJS();
return (
<ul className={this.props.className}>
<ul onClick={this.props.onClick} className={this.props.className}>
<li><Link to='/' className="btn"><i className="fa fa-th"></i>Library</Link></li>
<NeedAuthorization>
<li><Link to='/metadata' className="btn"><i className="fa fa-list-alt"></i>Metadata</Link></li>
Expand All @@ -31,7 +31,8 @@ class Menu extends Component {

Menu.propTypes = {
user: PropTypes.object,
className: PropTypes.string
className: PropTypes.string,
onClick: PropTypes.func
};

export function mapStateToProps({user}) {
Expand Down
4 changes: 2 additions & 2 deletions app/react/App/scss/elements/_controls.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@

.fa {
display: inline-block;
width: 60px;
line-height: 60px;
width: 54px;
line-height: 54px;
margin: 0 0 0 14px;
text-align: center;
font-size: $f-size-lg;
Expand Down
2 changes: 1 addition & 1 deletion app/react/App/scss/fixes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
flex-direction: column;
height: 100vh;
padding-top: 60px;
padding-top: 54px;
overflow: hidden;
}

Expand Down
25 changes: 16 additions & 9 deletions app/react/App/scss/layout/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ header {
font-style: italic;
font-weight: 300;
margin: 0;
line-height: 60px;
line-height: 54px;
display: none;
@include desktop {
display: block;
}
}

.input-group {
line-height: 50px;
padding: 5px 0px;
line-height: 54px;
@include desktop {
margin: 0 -30px;
}
Expand Down Expand Up @@ -79,17 +78,23 @@ header {
}

.nav-pills {
position: fixed;
top: 54px;
left: 0;
right: 0;
display: none;
line-height: 60px;
line-height: 54px;
padding: 0;
box-shadow: $shadow;
background: $c-white;
&.is-active {
display: block;
}
@include desktop {
position: relative;
top: 0;
display: block;
text-align: right;
padding-right: 5px;
box-shadow: none;
}
> li {
Expand All @@ -109,19 +114,21 @@ header {
}
a {
color: $c-black;
border-radius: 0;
}
}

/* menu buttons */
.fa-bars {
.menu-button {
z-index: 1;
float: left;
width: 60px;
height: 60px;
line-height: 60px;
width: 54px;
height: 54px;
line-height: 54px;
padding: 0 15px;
margin-left: -15px;
text-align: center;
font-size: $f-size-lg;
cursor: pointer;
@include desktop {
display: none;
Expand Down
7 changes: 4 additions & 3 deletions app/react/App/scss/layout/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ nav ul {
}
}

.nav>li>a {
padding: 6px 10px;
line-height: 44px;
.nav > li > a {
padding: 0px 10px;
line-height: 54px;
border: 0;
}
2 changes: 1 addition & 1 deletion app/react/App/scss/modules/_login.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
flex-direction: column;
justify-content: center;
padding-bottom: 60px;
padding-bottom: 54px;
}

.login-title {
Expand Down
2 changes: 1 addition & 1 deletion app/react/App/scss/modules/_uploads.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: block;
position: relative;
max-width: 1024px;
padding: 25px 45px 20px 60px;
padding: 25px 45px 20px 54px;
margin: auto;
margin-bottom: 15px;
text-align: center;
Expand Down
4 changes: 2 additions & 2 deletions app/react/ContextMenu/scss/contextMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
background: $c-success;
color: $c-white;
text-align: center;
line-height: 60px;
width: 60px;
line-height: 54px;
width: 54px;
box-shadow: $shadow;
border-radius: 50%;
font-size: $f-size-lg;
Expand Down
2 changes: 1 addition & 1 deletion app/react/Layout/scss/sidepanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
$c-sidebar: darken($c-primary-lighten, 2%);
position: fixed;
right: 0;
top: 60px;
top: 54px;
bottom: 0;
padding: 15px;
overflow-y: scroll;
Expand Down
1 change: 0 additions & 1 deletion app/react/Users/specs/SettingsAPI.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import backend from 'fetch-mock';
import {catchErrors} from 'api/utils/jasmineHelpers';

describe('SettingsAPI', () => {

beforeEach(() => {
backend.restore();
backend
Expand Down
1 change: 0 additions & 1 deletion app/react/Users/specs/UsersAPI.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import backend from 'fetch-mock';
import {catchErrors} from 'api/utils/jasmineHelpers';

describe('UsersAPI', () => {

beforeEach(() => {
backend.restore();
backend
Expand Down

0 comments on commit b668f6f

Please sign in to comment.