From 86b4f8e82c51d641d55c8711a4ad883d58835ace Mon Sep 17 00:00:00 2001 From: Baltazar Gomez Date: Mon, 7 Aug 2017 22:10:42 -0600 Subject: [PATCH 1/5] add forward button add forward history diseable conditionals fix last commit update CHANGELOG.md --- CHANGELOG.md | 3 ++- ui/js/actions/app.js | 8 ++++++++ ui/js/component/header/index.js | 3 ++- ui/js/component/header/view.jsx | 17 +++++++++++++++-- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e06149cfe..5bdc2e57b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,9 @@ Web UI version numbers should always match the corresponding version of LBRY App ### Added * Added a new component, `FormFieldPrice` which is now used in Publish and Settings * Added wallet backup guide reference + * Added feature: forward history * - + ### Changed * Updated to daemon [0.15](https://github.com/lbryio/lbry/releases). Most relevant changes for app are improved announcing of content and a fix for the daemon getting stuck running. * Some form field refactoring as we progress towards form sanity. diff --git a/ui/js/actions/app.js b/ui/js/actions/app.js index 44964b0ba..4c5c31ded 100644 --- a/ui/js/actions/app.js +++ b/ui/js/actions/app.js @@ -84,6 +84,14 @@ export function doHistoryBack() { }; } +export function doHistoryForward() { + return function(dispatch, getState) { + if (!history.state) return; + + history.forward(); + }; +} + export function doHistoryPush(currentState, title, relativeUrl) { return function(dispatch, getState) { title += " - LBRY"; diff --git a/ui/js/component/header/index.js b/ui/js/component/header/index.js index eda8923d3..cd5242512 100644 --- a/ui/js/component/header/index.js +++ b/ui/js/component/header/index.js @@ -2,7 +2,7 @@ import React from "react"; import { formatCredits } from "utils"; import { connect } from "react-redux"; import { selectBalance } from "selectors/wallet"; -import { doNavigate, doHistoryBack } from "actions/app"; +import { doNavigate, doHistoryBack, doHistoryForward } from "actions/app"; import Header from "./view"; const select = state => ({ @@ -13,6 +13,7 @@ const select = state => ({ const perform = dispatch => ({ navigate: path => dispatch(doNavigate(path)), back: () => dispatch(doHistoryBack()), + forward: () => dispatch(doHistoryForward()), }); export default connect(select, perform)(Header); diff --git a/ui/js/component/header/view.jsx b/ui/js/component/header/view.jsx index 76758b210..ec1e6ff98 100644 --- a/ui/js/component/header/view.jsx +++ b/ui/js/component/header/view.jsx @@ -3,12 +3,25 @@ import Link from "component/link"; import WunderBar from "component/wunderbar"; export const Header = props => { - const { balance, back, navigate, publish } = props; + const { balance, back, forward, navigate, publish } = props; return (