From f1742eca25c8cf726704feef814173287b68cf29 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 3 Feb 2020 12:23:21 -0500 Subject: [PATCH] Revert "Right Click to Navigate History (#3547)" This reverts commit 6d88d87ff27c8fcf56991bd3f00dd49110175143. --- static/app-strings.json | 7 +- ui/component/header/view.jsx | 28 ++++---- ui/component/navigationButton/index.js | 3 - ui/component/navigationButton/view.jsx | 91 -------------------------- ui/component/router/index.js | 29 ++------ ui/component/router/view.jsx | 45 ------------- ui/page/show/view.jsx | 21 +++++- ui/scss/component/_header.scss | 26 -------- ui/scss/component/menu-button.scss | 2 - ui/store.js | 4 +- 10 files changed, 48 insertions(+), 208 deletions(-) delete mode 100644 ui/component/navigationButton/index.js delete mode 100644 ui/component/navigationButton/view.jsx diff --git a/static/app-strings.json b/static/app-strings.json index 87ed5d91e..67e0ef012 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -915,7 +915,12 @@ "Support %amount% LBC": "Support %amount% LBC", "You deposited %amount% LBC as a support!": "You deposited %amount% LBC as a support!", "LBRY Link": "LBRY Link", + "Publish to %uri%": "Publish to %uri%", "Your wallet": "Your wallet", "Publish a file, or create a channel": "Publish a file, or create a channel", - "Your account": "Your account" + "Your account": "Your account", + "Channel profile picture": "Channel profile picture", + "refreshing the app": "refreshing the app", + "Follower": "Follower", + "%repost_channel_link% reposted": "%repost_channel_link% reposted" } \ No newline at end of file diff --git a/ui/component/header/view.jsx b/ui/component/header/view.jsx index ecba00685..343167754 100644 --- a/ui/component/header/view.jsx +++ b/ui/component/header/view.jsx @@ -11,7 +11,6 @@ import WunderBar from 'component/wunderbar'; import Icon from 'component/common/icon'; import { Menu, MenuList, MenuButton, MenuItem } from '@reach/menu-button'; import Tooltip from 'component/common/tooltip'; -import NavigationButton from 'component/navigationButton'; // @if TARGET='app' import { IS_MAC } from 'component/app/view'; // @endif @@ -19,15 +18,7 @@ import { IS_MAC } from 'component/app/view'; type Props = { balance: string, roundedBalance: number, - history: { - entities: {}[], - goBack: () => void, - goForward: () => void, - index: number, - length: number, - location: { pathname: string }, - push: string => void, - }, + history: { push: string => void, goBack: () => void, goForward: () => void, location: { pathname: string } }, currentTheme: string, automaticDarkModeEnabled: boolean, setClientSetting: (string, boolean | string) => void, @@ -114,8 +105,21 @@ const Header = (props: Props) => { {/* @if TARGET='app' */} {!authHeader && (
- - +
)} {/* @endif */} diff --git a/ui/component/navigationButton/index.js b/ui/component/navigationButton/index.js deleted file mode 100644 index 81cb43a8e..000000000 --- a/ui/component/navigationButton/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import NavigationButton from './view'; - -export default NavigationButton; diff --git a/ui/component/navigationButton/view.jsx b/ui/component/navigationButton/view.jsx deleted file mode 100644 index 72c9cb017..000000000 --- a/ui/component/navigationButton/view.jsx +++ /dev/null @@ -1,91 +0,0 @@ -// @flow -import React, { useState, useCallback } from 'react'; -import * as ICONS from 'constants/icons'; -import Button from 'component/button'; - -// the maximum length of history to show per button -const MAX_HISTORY_SIZE = 12; - -type Props = { - isBackward: boolean, - history: { - entries: Array<{ key: string, title: string, pathname: string }>, - go: number => void, - goBack: () => void, - goForward: () => void, - index: number, - length: number, - location: { pathname: string }, - push: string => void, - }, -}; - -// determines which slice of entries should make up the back or forward button drop-downs (isBackward vs !isBackward respectively) -const sliceEntries = (currentIndex, entries, historyLength, isBackward, maxSize) => { - let l = isBackward ? 0 : currentIndex + 1; - let r = isBackward ? currentIndex : historyLength; - const exceedsMax = maxSize < r - l; - if (!exceedsMax) { - return entries.slice(l, r); - } else if (isBackward) { - l = r - maxSize; - } else { - r = l + maxSize; - } - return entries.slice(l, r); -}; - -const NavigationButton = (props: Props) => { - const { isBackward, history } = props; - const { entries, go } = history; - const currentIndex = history.index; - const historyLength = history.length; - const [showHistory, setShowHistory] = useState(false); - - // creates an
  • intended for the button's