From f3e2a8a29caf0d7c2e1e802f8630f0d1977af58b Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Sun, 31 Mar 2019 19:04:01 -0400 Subject: [PATCH] combine history and downloads page --- src/ui/component/button/view.jsx | 6 +- src/ui/component/cardMedia/view.jsx | 2 +- src/ui/component/common/icon-custom.jsx | 25 +++---- src/ui/component/common/icon.jsx | 15 +++- src/ui/component/header/view.jsx | 68 +++++++++---------- .../index.js | 1 - .../view.jsx | 9 ++- .../index.js | 0 .../component/navigationHistoryItem/view.jsx | 68 +++++++++++++++++++ .../navigationHistoryRecent/index.js | 12 ++++ .../navigationHistoryRecent/view.jsx | 37 ++++++++++ src/ui/component/router/view.jsx | 13 ++-- src/ui/component/sideBar/view.jsx | 55 +++++++-------- .../component/transactionListRecent/view.jsx | 4 +- src/ui/component/userHistoryItem/view.jsx | 61 ----------------- src/ui/constants/content.js | 1 - src/ui/constants/icons.js | 4 +- src/ui/constants/pages.js | 4 +- src/ui/page/{wallet => account}/index.js | 0 src/ui/page/{wallet => account}/view.jsx | 0 src/ui/page/fileListDownloaded/view.jsx | 6 +- src/ui/page/navigationHistory/index.js | 3 + src/ui/page/navigationHistory/view.jsx | 13 ++++ src/ui/page/userHistory/view.jsx | 4 +- src/ui/redux/selectors/content.js | 43 ++++++------ src/ui/scss/component/_header.scss | 38 +++++++---- src/ui/scss/component/_item-list.scss | 25 ++++--- src/ui/scss/component/_navigation.scss | 9 ++- src/ui/scss/component/_time.scss | 2 +- 29 files changed, 316 insertions(+), 212 deletions(-) rename src/ui/component/{userHistory => navigationHistory}/index.js (90%) rename src/ui/component/{userHistory => navigationHistory}/view.jsx (96%) rename src/ui/component/{userHistoryItem => navigationHistoryItem}/index.js (100%) create mode 100644 src/ui/component/navigationHistoryItem/view.jsx create mode 100644 src/ui/component/navigationHistoryRecent/index.js create mode 100644 src/ui/component/navigationHistoryRecent/view.jsx delete mode 100644 src/ui/component/userHistoryItem/view.jsx rename src/ui/page/{wallet => account}/index.js (100%) rename src/ui/page/{wallet => account}/view.jsx (100%) create mode 100644 src/ui/page/navigationHistory/index.js create mode 100644 src/ui/page/navigationHistory/view.jsx diff --git a/src/ui/component/button/view.jsx b/src/ui/component/button/view.jsx index a71c85989..a92322175 100644 --- a/src/ui/component/button/view.jsx +++ b/src/ui/component/button/view.jsx @@ -107,9 +107,11 @@ class Button extends React.PureComponent { to={path} title={title} onClick={e => e.stopPropagation()} - getProps={({ isCurrent }) => ({ + getProps={({ isCurrent, isPartiallyCurrent }) => ({ className: - isCurrent && activeClass ? `${combinedClassName} ${activeClass}` : combinedClassName, + (path === '/' ? isCurrent : isPartiallyCurrent) && activeClass + ? `${combinedClassName} ${activeClass}` + : combinedClassName, })} > {content} diff --git a/src/ui/component/cardMedia/view.jsx b/src/ui/component/cardMedia/view.jsx index 54e692eee..6c9f41994 100644 --- a/src/ui/component/cardMedia/view.jsx +++ b/src/ui/component/cardMedia/view.jsx @@ -15,7 +15,7 @@ class CardMedia extends React.PureComponent { style={ thumbnail ? { backgroundImage: `url('${thumbnail}')` } - : { backgroundImage: `url(${Placeholder})` } + : { backgroundImage: `url(/${Placeholder})` } } className="media__thumb" /> diff --git a/src/ui/component/common/icon-custom.jsx b/src/ui/component/common/icon-custom.jsx index d409c31dc..723dd3182 100644 --- a/src/ui/component/common/icon-custom.jsx +++ b/src/ui/component/common/icon-custom.jsx @@ -1,6 +1,7 @@ // @flow +import type { Node } from 'react'; import * as ICONS from 'constants/icons'; -import React, { Fragment } from 'react'; +import React from 'react'; type IconProps = { size: number, @@ -8,7 +9,7 @@ type IconProps = { }; // Returns a react component -const buildIcon = iconStrokes => (props: IconProps) => { +const buildIcon = (iconStrokes: Node, options?: {} = {}) => (props: IconProps) => { const { size = 24, color = 'currentColor', ...otherProps } = props; return ( (props: IconProps) => { viewBox="0 0 24 24" width={size} height={size} - fill="solid" + fill="none" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" + {...options} {...otherProps} > {iconStrokes} @@ -114,16 +116,11 @@ export const customIcons = { [ICONS.UNSUBSCRIBE]: buildIcon( ), - [ICONS.LBRY]: buildIcon( - - - - + // The LBRY icon is different from the base icon set so don't use buildIcon() + [ICONS.LBRY]: props => ( + + + + ), }; diff --git a/src/ui/component/common/icon.jsx b/src/ui/component/common/icon.jsx index 4bd03fb34..15de1ba9b 100644 --- a/src/ui/component/common/icon.jsx +++ b/src/ui/component/common/icon.jsx @@ -2,6 +2,7 @@ import * as ICONS from 'constants/icons'; import React from 'react'; import Tooltip from 'component/common/tooltip'; +import classnames from 'classnames'; import { customIcons } from './icon-custom'; let featherIcons = false; @@ -35,6 +36,7 @@ type Props = { tooltip?: string, // tooltip direction iconColor?: string, size?: number, + className?: string, }; class IconComponent extends React.PureComponent { @@ -63,7 +65,7 @@ class IconComponent extends React.PureComponent { }; render() { - const { icon, tooltip, iconColor, size } = this.props; + const { icon, tooltip, iconColor, size, className } = this.props; const Icon = customIcons[this.props.icon] || LazyFeatherIcons[this.props.icon]; if (!Icon) { @@ -83,9 +85,16 @@ class IconComponent extends React.PureComponent { } const inner = ( } + fallback={ + + } > - + ); diff --git a/src/ui/component/header/view.jsx b/src/ui/component/header/view.jsx index 0e53da099..75d923e62 100644 --- a/src/ui/component/header/view.jsx +++ b/src/ui/component/header/view.jsx @@ -4,6 +4,7 @@ import * as React from 'react'; import Button from 'component/button'; import LbcSymbol from 'component/common/lbc-symbol'; import WunderBar from 'component/wunderbar'; +import Icon from 'component/common/icon'; type Props = { autoUpdateDownloaded: boolean, @@ -37,42 +38,26 @@ const Header = (props: Props) => {
{/* @if TARGET='app' */} -
+ {/* @endif */} {/* @if TARGET='web' */}