From 449165abc92bdf84c19f4d687c707a4425f8208c Mon Sep 17 00:00:00 2001 From: GeordieP Date: Tue, 8 May 2018 15:37:18 -0400 Subject: [PATCH] Current page is now visible in nav bar (current page icon is highlighted). --- src/app/components/NavBar.jsx | 12 +++++++----- src/app/pages/index.jsx | 14 ++++++++------ src/app/pages/launchStream.jsx | 2 +- src/app/pages/logs.jsx | 2 +- src/app/pages/preferences.jsx | 2 +- src/app/styles/components/NavBar.styl | 4 ++++ src/app/styles/main.styl | 4 ++++ 7 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/app/components/NavBar.jsx b/src/app/components/NavBar.jsx index 2e92596..d995652 100644 --- a/src/app/components/NavBar.jsx +++ b/src/app/components/NavBar.jsx @@ -1,16 +1,18 @@ import { h } from 'hyperapp' import { Link } from 'hyperapp-hash-router' +const applyCurRouteStyle = (curPath, routePath) => + routePath === curPath ? ' selected' : '' + export default (props, children) => ( diff --git a/src/app/pages/index.jsx b/src/app/pages/index.jsx index 13095ac..2b4dc25 100644 --- a/src/app/pages/index.jsx +++ b/src/app/pages/index.jsx @@ -38,7 +38,8 @@ const IndexNavbar = ({ refreshFollowList, showContextMenu, disableFollowListAutoRefresh, - enableFollowListAutoRefresh}) => { + enableFollowListAutoRefresh, + path }) => { const menuItems = [ { label: 'Refresh now', @@ -57,21 +58,21 @@ const IndexNavbar = ({ const showMenu = event => showContextMenu({ event, items: menuItems }) return ( - - + + > + } /> ) @@ -90,6 +91,7 @@ export default () => (state, actions) => { showContextMenu={actions.contextMenu.show} disableFollowListAutoRefresh={actions.disableFollowListAutoRefresh} enableFollowListAutoRefresh={actions.enableFollowListAutoRefresh} + path={state.location.pathname} /> {state.streams.length > 0 ? ( diff --git a/src/app/pages/launchStream.jsx b/src/app/pages/launchStream.jsx index 7cbba40..5508ab1 100644 --- a/src/app/pages/launchStream.jsx +++ b/src/app/pages/launchStream.jsx @@ -12,7 +12,7 @@ export default () => (state, actions) => { return (
- +
diff --git a/src/app/pages/logs.jsx b/src/app/pages/logs.jsx index 221d44a..930013f 100644 --- a/src/app/pages/logs.jsx +++ b/src/app/pages/logs.jsx @@ -23,7 +23,7 @@ export default () => (state, actions) => { } return (
- +
(state, actions) => { return (
- +
diff --git a/src/app/styles/components/NavBar.styl b/src/app/styles/components/NavBar.styl index 54028e4..ed82571 100644 --- a/src/app/styles/components/NavBar.styl +++ b/src/app/styles/components/NavBar.styl @@ -32,6 +32,10 @@ nav { background: lighten($clr_pageBg, 9%) } } + + .selected { + color: #ccc + } } // navChildren and navEnd should have subtle left borders to separate them from other nav sections diff --git a/src/app/styles/main.styl b/src/app/styles/main.styl index e76217d..47d9c2e 100644 --- a/src/app/styles/main.styl +++ b/src/app/styles/main.styl @@ -83,6 +83,10 @@ strong { justify-content: space-between } +.clickable { + cursor: pointer +} + input, select, button, textarea { background: lighten($clr_pageBg, 12%) border: none