From ef9b34c51f0018b4cf755c1f8946852c41003891 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 2 Jan 2020 15:36:03 -0500 Subject: [PATCH] cleanup --- ui/component/app/view.jsx | 7 ---- ui/component/claimList/view.jsx | 45 +++++++++++++----------- ui/component/claimListDiscover/view.jsx | 11 ++++-- ui/component/header/view.jsx | 8 +++-- ui/component/recommendedContent/view.jsx | 16 ++++----- ui/component/router/view.jsx | 2 +- ui/page/channelsFollowing/view.jsx | 41 +++++++++++++-------- ui/page/channelsFollowingManage/view.jsx | 24 ++++++------- ui/page/discover/view.jsx | 11 +++++- ui/page/fileListDownloaded/view.jsx | 11 +++--- ui/page/fileListPublished/view.jsx | 6 ++-- ui/page/tagsFollowing/view.jsx | 18 +++++++++- ui/scss/component/_button.scss | 1 + ui/scss/component/_channel.scss | 1 - ui/scss/component/_claim-list.scss | 31 ++++++++++------ ui/scss/component/_header.scss | 4 +++ ui/scss/init/_gui.scss | 7 ---- ui/scss/init/_vars.scss | 2 +- 18 files changed, 146 insertions(+), 100 deletions(-) diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index 0a7e99487..0a1716758 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -147,13 +147,6 @@ function App(props: Props) { } }, [previousRewardApproved, isRewardApproved]); - // @if TARGET='app' - useEffect(() => { - console.log('update prefs'); - updatePreferences(); - }, []); - // @endif - // Keep this at the end to ensure initial setup effects are run first useEffect(() => { // Wait for balance to be populated on desktop so we know when we can begin syncing diff --git a/ui/component/claimList/view.jsx b/ui/component/claimList/view.jsx index 832b7fca4..36063c06b 100644 --- a/ui/component/claimList/view.jsx +++ b/ui/component/claimList/view.jsx @@ -28,6 +28,7 @@ type Props = { // If using the default header, this is a unique ID needed to persist the state of the filter setting persistedStorageKey?: string, showHiddenByUser: boolean, + headerLabel?: string | Node, }; export default function ClaimList(props: Props) { @@ -45,6 +46,7 @@ export default function ClaimList(props: Props) { page, id, showHiddenByUser, + headerLabel, } = props; const [scrollBottomCbMap, setScrollBottomCbMap] = useState({}); const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW); @@ -97,29 +99,32 @@ export default function ClaimList(props: Props) { })} > {header !== false && ( -
- {header} - {loading && } -
- {headerAltControls} - {defaultSort && ( - - - - - )} + + {headerLabel && } +
+ {header} + {loading && } +
+ {headerAltControls} + {defaultSort && ( + + + + + )} +
-
+ )} {urisLength > 0 && ( -
    +
      {sortedUris.map((uri, index) => ( )} - {urisLength === 0 && !loading &&
      {empty || __('No results')}
      } + {urisLength === 0 && !loading &&
      {empty || __('No results')}
      } ); } diff --git a/ui/component/claimListDiscover/view.jsx b/ui/component/claimListDiscover/view.jsx index d62f192ab..a7d37d997 100644 --- a/ui/component/claimListDiscover/view.jsx +++ b/ui/component/claimListDiscover/view.jsx @@ -45,6 +45,7 @@ type Props = { hiddenNsfwMessage?: Node, channelIds?: Array, defaultTypeSort?: string, + headerLabel?: string | Node, }; function ClaimListDiscover(props: Props) { @@ -62,6 +63,7 @@ function ClaimListDiscover(props: Props) { hiddenUris, hiddenNsfwMessage, defaultTypeSort, + headerLabel, } = props; const didNavigateForward = history.action === 'PUSH'; const [page, setPage] = useState(1); @@ -221,12 +223,13 @@ function ClaimListDiscover(props: Props) { ); return ( -
      + - {loading && new Array(PAGE_SIZE).fill(1).map((x, i) => )} -
      +
      + {loading && new Array(PAGE_SIZE).fill(1).map((x, i) => )} +
      + ); } diff --git a/ui/component/header/view.jsx b/ui/component/header/view.jsx index 3b300a6b3..bba777a34 100644 --- a/ui/component/header/view.jsx +++ b/ui/component/header/view.jsx @@ -51,8 +51,12 @@ const Header = (props: Props) => { const isAuthPage = history.location.pathname.includes(PAGES.AUTH); // Sign out if they click the "x" when they are on the password prompt - const authHeaderAction = syncError ? { onClick: signOut } : { navigate: '/' }; - const homeButtonNavigationProps = isVerifyPage ? {} : authHeader ? authHeaderAction : { navigate: '/' }; + const authHeaderAction = syncError ? { onClick: signOut } : { navigate: `/$/${PAGES.CHANNELS_FOLLOWING}` }; + const homeButtonNavigationProps = isVerifyPage + ? {} + : authHeader + ? authHeaderAction + : { navigate: `/$/${PAGES.CHANNELS_FOLLOWING}` }; const closeButtonNavigationProps = authHeader ? authHeaderAction : { onClick: () => history.goBack() }; function handleThemeToggle() { diff --git a/ui/component/recommendedContent/view.jsx b/ui/component/recommendedContent/view.jsx index dd3c791d6..9a0877b2a 100644 --- a/ui/component/recommendedContent/view.jsx +++ b/ui/component/recommendedContent/view.jsx @@ -51,15 +51,13 @@ export default class RecommendedContent extends React.PureComponent { const { recommendedContent, isSearching } = this.props; return ( -
      - -
      + ); } } diff --git a/ui/component/router/view.jsx b/ui/component/router/view.jsx index a5f48ecc5..c6944c625 100644 --- a/ui/component/router/view.jsx +++ b/ui/component/router/view.jsx @@ -73,7 +73,7 @@ function AppRouter(props: Props) { return ( - {/* */} + diff --git a/ui/page/channelsFollowing/view.jsx b/ui/page/channelsFollowing/view.jsx index fcb30b07e..b1c15624b 100644 --- a/ui/page/channelsFollowing/view.jsx +++ b/ui/page/channelsFollowing/view.jsx @@ -1,10 +1,12 @@ // @flow import * as PAGES from 'constants/pages'; +import * as ICONS from 'constants/icons'; import React from 'react'; import ClaimListDiscover from 'component/claimListDiscover'; import ClaimList from 'component/claimList'; import Page from 'component/page'; import Button from 'component/button'; +import Icon from 'component/common/icon'; import { TYPE_NEW } from 'component/claimListDiscover/view'; @@ -29,24 +31,35 @@ function ChannelsFollowing(props: Props) { return ( {showTab ? ( -
      - setShowTab(false)} - /> - } - uris={suggestedSubscriptions.map(sub => `lbry://${sub.uri}`)} - /> -
      + setShowTab(false)} + /> + } + uris={suggestedSubscriptions.map(sub => `lbry://${sub.uri}`)} + /> ) : ( + + {__('Following')} + + } defaultTypeSort={TYPE_NEW} channelIds={subscribedChannels.map(sub => sub.uri.split('#')[1])} - meta={