Skip to content

Commit

Permalink
Merge pull request #215 from pertrai1/header-navigation-icons
Browse files Browse the repository at this point in the history
Header icons stay in place in desktop mode
  • Loading branch information
DaleMcGrew committed Apr 16, 2016
2 parents fe7f57d + ecaec55 commit 80ecc66
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/js/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { Component, PropTypes } from "react";
import { Link } from "react-router";
import HeaderIcons from "./Navigation/HeaderIcons";

export default class Header extends Component {
static propTypes = {
Expand Down Expand Up @@ -61,11 +62,12 @@ export default class Header extends Component {
</Link>
<span className="header-version"> demo</span>
</h4>
<aside className="header-address pull-right gutter-right--window gutter-top--small">
<div className="header-address pull-right gutter-right--window gutter-top--small">
<Link to="/settings/location" className="font-lightest">
{location}
</Link>
</aside>
</div>
<HeaderIcons />
</section>
{/* The components/MoreMenu code has to be reproduced here for mobile */}
<div className={(visible ? "visible" : "hidden") + " device-menu--mobile container-fluid well well-90"}>
Expand Down
106 changes: 106 additions & 0 deletions src/js/components/Navigation/HeaderIcons.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import React, { Component, PropTypes } from "react";
import { Link } from "react-router";

// import "stylesheets/main.scss";

const links = {
ballot: function (active) {
var icon = "glyphicon glyphicon-list-alt glyphicon-line-adjustment font-footer_icon";

var jsx =
<Link to="/ballot" className={ "navicon" + (active ? " active-icon" : "")}>
<div className="col-xs-3 center-block text-center">
<span className={icon} title="Ballot"></span>
<br/>
<span className="text-center small device-small--hide">
Ballot
</span>
</div>
</Link>;

return jsx;
},

/* className="badgeTotal badge">0</span> TODO badge should only show if positive number */
requests: function (active) {
var icon = "glyphicon glyphicon-inbox glyphicon-line-adjustment font-footer_icon";

var jsx =
<Link to="/requests" className={ "navicon" + (active ? " active-icon" : "")}>
<div className="col-xs-3 center-block text-center">
<span className={icon} title="Requests">
</span>
<br/>
<span className="text-center small device-small--hide">
Requests
</span>
</div>
</Link>;

return jsx;
},

connect: function (active) {
var icon = "glyphicon icon-icon-connect-1-3 font-footer_icon";

var jsx =
<Link to="/connect" className={ "navicon" + (active ? " active-icon" : "")}>
<div className="col-xs-3 center-block text-center">
<span className={icon} title="Connect"></span>
<br/>
<span className="text-center small device-small--hide">
Connect
</span>
</div>
</Link>;

return jsx;
},

activity: function (active) {
var icon = "glyphicon icon-icon-activity-1-4 font-footer_icon";

var jsx =
<Link to="/activity" className={ "navicon" + (active ? " active-icon" : "")}>
<div className="col-xs-3 center-block text-center">
<span className={icon} title="Activity"></span>
<br/>
<span className="text-center small device-small--hide">
Activity
</span>
</div>
</Link>;

return jsx;
}
};

export default class Navigator extends Component {
static propTypes = {
pathname: PropTypes.string
};

render () {
var { props: { pathname } } = this;
var { ballot, requests, connect, activity } = links;

const navigator =
<div className="navigator row">
<div className="container-fluid">
<div className="device-headericons--large">
<div className="container-fluid fluff-loose--top separate-top">
<div className="row">
{ballot(pathname === "/ballot")}
{requests(pathname === "/requests")}
{connect(pathname === "/connect")}
{activity(pathname === "/activity")}
</div>
</div>
</div>
</div>
</div>;

return navigator;

}
}
2 changes: 1 addition & 1 deletion src/js/components/Navigator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class Navigator extends Component {
const navigator =
<div className="navigator row">
<div className="container-fluid">
<div className="navbar navbar-default navbar-fixed-bottom device-footer--large">
<div className="navbar navbar-default navbar-fixed-bottom">
<div className="container-fluid fluff-loose--top separate-top">
<div className="row">
{ballot(pathname === "/ballot")}
Expand Down
14 changes: 13 additions & 1 deletion src/sass/layout/_mediaquery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,19 @@
}
}

@media all and (max-width: 661px) {
.device {
&-headericons--large {
display: none;
}
}
}


@media all and (min-width : 660px) {
.navbar-fixed-bottom {
display: none;
}
.device {
&-menu {
&--large {
Expand All @@ -58,13 +69,14 @@
width: 220px;
}
}
&-footer {
&-headericons {
&--large {
background: transparent;
border-color: #fff;
display: inline-block;
height: 45px;
left: auto;
position: fixed;
right: 0;
top: 0;

Expand Down

0 comments on commit 80ecc66

Please sign in to comment.