From be85c74b2aefee71e366b235088ffad6ea5f4fd4 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 26 Jun 2019 13:31:15 -0400 Subject: [PATCH 01/21] cleanup and add tags to publish page --- src/ui/component/button/view.jsx | 4 ++-- .../page/following/{index.js => index.js~HEAD} | 0 ...index.js~cleanup and add tags to publish page | 16 ++++++++++++++++ src/ui/page/subscriptions/view.jsx | 3 ++- 4 files changed, 20 insertions(+), 3 deletions(-) rename src/ui/page/following/{index.js => index.js~HEAD} (100%) create mode 100644 src/ui/page/following/index.js~cleanup and add tags to publish page diff --git a/src/ui/component/button/view.jsx b/src/ui/component/button/view.jsx index f34e0cf7e..e7531bcd7 100644 --- a/src/ui/component/button/view.jsx +++ b/src/ui/component/button/view.jsx @@ -77,10 +77,10 @@ const Button = forwardRef((props: Props, ref: any) => { const content = ( - {icon && } + {icon && } {label && {label}} {children && children} - {iconRight && } + {iconRight && } ); diff --git a/src/ui/page/following/index.js b/src/ui/page/following/index.js~HEAD similarity index 100% rename from src/ui/page/following/index.js rename to src/ui/page/following/index.js~HEAD diff --git a/src/ui/page/following/index.js~cleanup and add tags to publish page b/src/ui/page/following/index.js~cleanup and add tags to publish page new file mode 100644 index 000000000..97edfb98c --- /dev/null +++ b/src/ui/page/following/index.js~cleanup and add tags to publish page @@ -0,0 +1,16 @@ +import { connect } from 'react-redux'; +import { selectFollowedTags } from 'lbry-redux'; +import { selectSubscriptions } from 'redux/selectors/subscriptions'; +import TagsEdit from './view'; + +const select = state => ({ + followedTags: selectFollowedTags(state), + subscribedChannels: selectSubscriptions(state), +}); + +const perform = {}; + +export default connect( + select, + perform +)(TagsEdit); diff --git a/src/ui/page/subscriptions/view.jsx b/src/ui/page/subscriptions/view.jsx index 193098d70..790eb5712 100644 --- a/src/ui/page/subscriptions/view.jsx +++ b/src/ui/page/subscriptions/view.jsx @@ -73,7 +73,8 @@ export default function SubscriptionsPage(props: Props) { onClick={() => onClick()} /> } - uris={viewingSuggestedSubs ? suggestedSubscriptions.map(sub => sub.uri) : uris} + // Fix the need to reverse this + uris={viewingSuggestedSubs ? suggestedSubscriptions.map(sub => sub.uri) : uris.reverse()} /> From dddeb52f09836a61f93ffcbcf076afdf9f91f956 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 26 Jun 2019 16:17:39 -0400 Subject: [PATCH 02/21] fix: button color --- src/ui/component/button/view.jsx | 4 ++-- static/locales/en.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/component/button/view.jsx b/src/ui/component/button/view.jsx index e7531bcd7..f34e0cf7e 100644 --- a/src/ui/component/button/view.jsx +++ b/src/ui/component/button/view.jsx @@ -77,10 +77,10 @@ const Button = forwardRef((props: Props, ref: any) => { const content = ( - {icon && } + {icon && } {label && {label}} {children && children} - {iconRight && } + {iconRight && } ); diff --git a/static/locales/en.json b/static/locales/en.json index 840267460..49fc961e2 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -359,4 +359,4 @@ "Error data": "Error data", "Error": "Error", "We're sorry that LBRY has encountered an error. This has been reported and we will investigate the problem.": "We're sorry that LBRY has encountered an error. This has been reported and we will investigate the problem." -} \ No newline at end of file +} From 08eb6367bea887b1143273c3dfb9bf13e80156eb Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 26 Jun 2019 18:07:07 -0400 Subject: [PATCH 03/21] fix: claim list sorting --- src/ui/page/subscriptions/view.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ui/page/subscriptions/view.jsx b/src/ui/page/subscriptions/view.jsx index 790eb5712..193098d70 100644 --- a/src/ui/page/subscriptions/view.jsx +++ b/src/ui/page/subscriptions/view.jsx @@ -73,8 +73,7 @@ export default function SubscriptionsPage(props: Props) { onClick={() => onClick()} /> } - // Fix the need to reverse this - uris={viewingSuggestedSubs ? suggestedSubscriptions.map(sub => sub.uri) : uris.reverse()} + uris={viewingSuggestedSubs ? suggestedSubscriptions.map(sub => sub.uri) : uris} /> From 25a77adb014b187c9af55fd3b4535ba309263cd8 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 26 Jun 2019 14:11:05 -0400 Subject: [PATCH 04/21] fix yarn.lock --- static/locales/en.json | 107 +++++++++++++++++++++++++++++++++-------- 1 file changed, 88 insertions(+), 19 deletions(-) diff --git a/static/locales/en.json b/static/locales/en.json index 49fc961e2..2c0f875b0 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -292,7 +292,6 @@ "Comment": "Comment", "Your comment": "Your comment", "Post": "Post", - "Channel": "Channel", "No modifier provided after separator %s.": "No modifier provided after separator %s.", "Incompatible Daemon": "Incompatible Daemon", "Incompatible daemon running": "Incompatible daemon running", @@ -309,39 +308,109 @@ "Your version is out of date and may be unreliable or insecure.": "Your version is out of date and may be unreliable or insecure.", "Want to know what has changed?": "Want to know what has changed?", "release notes": "release notes", - "Remove from your library": "Remove from your library", - "Got it!": "Got it!", - "The better your tags are, the easier it will be for people to discover your content.": "The better your tags are, the easier it will be for people to discover your content.", - "No tags added": "No tags added", + "Read the FAQ": "Read the FAQ", + "Our FAQ answers many common questions.": "Our FAQ answers many common questions.", + "Get Live Help": "Get Live Help", + "Live help is available most hours in the": "Live help is available most hours in the", + "channel of our Discord chat room.": "channel of our Discord chat room.", + "Join Our Chat": "Join Our Chat", + "Report a Bug or Suggest a New Feature": "Report a Bug or Suggest a New Feature", + "Did you find something wrong? Think LBRY could add something useful and cool?": "Did you find something wrong? Think LBRY could add something useful and cool?", + "Submit a Bug Report/Feature Request": "Submit a Bug Report/Feature Request", + "Thanks! LBRY is made by its users.": "Thanks! LBRY is made by its users.", + "View your Log": "View your Log", + "Did something go wrong? Have a look in your log file, or send it to": "Did something go wrong? Have a look in your log file, or send it to", + "support": "support", + "Open Log": "Open Log", + "Open Log Folder": "Open Log Folder", + "Your LBRY app is up to date.": "Your LBRY app is up to date.", + "App": "App", + "Daemon (lbrynet)": "Daemon (lbrynet)", + "Loading...": "Loading...", + "Connected Email": "Connected Email", + "Update mailing preferences": "Update mailing preferences", + "Reward Eligible": "Reward Eligible", + "Platform": "Platform", + "Installation ID": "Installation ID", + "Access Token": "Access Token", + "Backup Your LBRY Credits": "Backup Your LBRY Credits", + "Your LBRY credits are controllable by you and only you, via wallet file(s) stored locally on your computer.": "Your LBRY credits are controllable by you and only you, via wallet file(s) stored locally on your computer.", + "Currently, there is no automatic wallet backup. If you lose access to these files, you will lose your credits permanently.": "Currently, there is no automatic wallet backup. If you lose access to these files, you will lose your credits permanently.", + "However, it is fairly easy to back up manually. To backup your wallet, make a copy of the folder listed below:": "However, it is fairly easy to back up manually. To backup your wallet, make a copy of the folder listed below:", + "Access to these files are equivalent to having access to your credits. Keep any copies you make of your wallet in a secure place.": "Access to these files are equivalent to having access to your credits. Keep any copies you make of your wallet in a secure place.", + "see this article": "see this article", + "A newer version of LBRY is available.": "A newer version of LBRY is available.", + "Download now!": "Download now!", + "none": "none", + "set email": "set email", + "Failed to load settings.": "Failed to load settings.", + "Transaction History": "Transaction History", + "Export": "Export", + "Export Transactions": "Export Transactions", + "lbry-transactions-history": "lbry-transactions-history", + "Show": "Show", + "All": "All", + "Spend": "Spend", + "Receive": "Receive", + "Channel": "Channel", + "Tip": "Tip", + "Support": "Support", + "Update": "Update", + "Abandon": "Abandon", + "Unlock Tip": "Unlock Tip", + "Only channel URIs may have a path.": "Only channel URIs may have a path.", + "Confirm Purchase": "Confirm Purchase", + "This will purchase": "This will purchase", + "for": "for", + "credits": "credits", + "No channel name after @.": "No channel name after @.", + "View channel": "View channel", + "Add to your library": "Add to your library", + "Web link": "Web link", + "Facebook": "Facebook", + "": "", + "Twitter": "Twitter", + "View on Spee.ch": "View on Spee.ch", + "LBRY App link": "LBRY App link", + "Done": "Done", + "You can't publish things quite yet": "You can't publish things quite yet", + "LBRY uses a blockchain, which is a fancy way of saying that users (you) are in control of your data.": "LBRY uses a blockchain, which is a fancy way of saying that users (you) are in control of your data.", + "Because of the blockchain, some actions require LBRY credits": "Because of the blockchain, some actions require LBRY credits", + "allows you to do some neat things, like paying your favorite creators for their content. And no company can stop you.": "allows you to do some neat things, like paying your favorite creators for their content. And no company can stop you.", + "LBRY Credits Required": "LBRY Credits Required", + " There are a variety of ways to get credits, including more than": " There are a variety of ways to get credits, including more than", + "in free rewards for participating in the LBRY beta.": "in free rewards for participating in the LBRY beta.", + "Checkout the rewards": "Checkout the rewards", + "Choose a File": "Choose a File", + "Choose A File": "Choose A File", + "Choose a file": "Choose a file", + "Choose Tags": "Choose Tags", + "The better the tags, the better people will find your content.": "The better the tags, the better people will find your content.", + "Clear": "Clear", + "A title is required": "A title is required", + "Checking the winning claim amount...": "Checking the winning claim amount...", + "The better the tags, the easier your content is to find.": "The better the tags, the easier your content is to find.", + "You aren't following any tags, try searching for one.": "You aren't following any tags, try searching for one.", + "Publishing...": "Publishing...", + "Success": "Success", + "File published": "File published", + "Your file has been published to LBRY at the address": "Your file has been published to LBRY at the address", + "The file will take a few minutes to appear for other LBRY users. Until then it will be listed as \"pending\" under your published files.": "The file will take a few minutes to appear for other LBRY users. Until then it will be listed as \"pending\" under your published files.", "You are currently editing a claim.": "You are currently editing a claim.", "If you don't choose a file, the file from your existing claim": "If you don't choose a file, the file from your existing claim", "will be used.": "will be used.", - "My description for this and that": "My description for this and that", - "Upload your thumbnail to": "Upload your thumbnail to", "You are currently editing this claim. If you change the URL, you will need to reselect a file.": "You are currently editing this claim. If you change the URL, you will need to reselect a file.", - "Add a price to this file": "Add a price to this file", - "Additional Options": "Additional Options", - "Checking the winning claim amount...": "Checking the winning claim amount...", "If you bid more than": "If you bid more than", "when someone navigates to": "when someone navigates to", "it will load your published content": "it will load your published content", "However, you can get a longer version of this URL for any bid": "However, you can get a longer version of this URL for any bid", - "Choose a thumbnail": "Choose a thumbnail", - "URI does not include name.": "URI does not include name.", "Editing...": "Editing...", - "Success": "Success", - "The updates will take a few minutes to appear for other LBRY users. Until then it will be listed as \"pending\" under your published files.": "The updates will take a few minutes to appear for other LBRY users. Until then it will be listed as \"pending\" under your published files.", - "Choose a file": "Choose a file", - "A name is required": "A name is required", - "This file is downloaded.": "This file is downloaded.", "It looks like you haven't published anything to LBRY yet.": "It looks like you haven't published anything to LBRY yet.", "Publish something new": "Publish something new", "View it on spee.ch": "View it on spee.ch", "New thumbnail": "New thumbnail", - "Add to your library": "Add to your library", "Follow": "Follow", "Claim sequence must be a number.": "Claim sequence must be a number.", - "A title is required": "A title is required", "Clearing": "Clearing", "A deposit amount is required": "A deposit amount is required", "Deposit cannot be 0": "Deposit cannot be 0", From 8f6e5e755971b012e1dda60f226b1e17fca15608 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 26 Jun 2019 20:12:26 -0400 Subject: [PATCH 05/21] update lbry-redux --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8eb59eb26..09f4dae56 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "jsmediatags": "^3.8.1", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#b3bf3f6d53410ff1c5415b51ca425341e364959f", + "lbry-redux": "lbryio/lbry-redux#141593500693a93db74c62ef5a9fe67b43896603", "lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845", "lint-staged": "^7.0.2", "localforage": "^1.7.1", From 68a18556bf540c8ec532f2a0dafb6e602931ee9b Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 20 Jun 2019 00:06:16 -0400 Subject: [PATCH 06/21] fix: sorting on 'library' page --- src/ui/component/claimList/view.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/component/claimList/view.jsx b/src/ui/component/claimList/view.jsx index c8f742e4f..3c74c2fdb 100644 --- a/src/ui/component/claimList/view.jsx +++ b/src/ui/component/claimList/view.jsx @@ -26,6 +26,7 @@ type Props = { export default function ClaimList(props: Props) { const { uris, headerAltControls, injectedItem, loading, persistedStorageKey, empty, meta, type, header } = props; const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW); + const sortedUris = uris && currentSort === SORT_NEW ? uris.slice().reverse() : uris; const hasUris = uris && !!uris.length; const sortedUris = (hasUris && (currentSort === SORT_NEW ? uris : uris.slice().reverse())) || []; From 2ca254a57356f9f142cc3ae09cc51b9b2d1eb842 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 27 Jun 2019 02:18:45 -0400 Subject: [PATCH 07/21] first version of infinite scroll --- package.json | 4 +- src/ui/component/app/index.js | 3 +- src/ui/component/app/view.jsx | 15 ++++-- src/ui/component/channelContent/view.jsx | 2 +- src/ui/component/claimList/view.jsx | 45 ++++++++++++++-- src/ui/component/claimListDiscover/view.jsx | 24 +++++++-- .../index.js => claimPreview/index.js~HEAD} | 0 src/ui/component/claimPreview/view.jsx | 22 ++++---- src/ui/component/common/icon-custom.jsx | 14 +++++ src/ui/component/fileDetails/view.jsx | 1 - src/ui/component/fileProperties/index.js | 3 +- src/ui/component/fileProperties/view.jsx | 19 ++++++- src/ui/component/fileRender/view.jsx | 8 ++- src/ui/component/tagsSearch/view.jsx | 2 +- .../component/transactionListRecent/view.jsx | 2 + src/ui/component/userEmail/view.jsx | 14 +++-- src/ui/constants/pages.js | 3 +- src/ui/page/account/view.jsx | 2 + src/ui/page/discover/view.jsx | 2 +- src/ui/page/file/view.jsx | 51 ++++++++++++++----- src/ui/page/following/view.jsx | 14 ++--- src/ui/page/subscriptions/view.jsx | 14 +++-- src/ui/page/wallet/view.jsx | 12 +++-- src/ui/scss/all.scss | 2 +- src/ui/scss/component/_channel.scss | 7 ++- .../{_file-list.scss => _claim-list.scss} | 33 +++++------- src/ui/scss/component/_file-properties.scss | 8 +++ src/ui/scss/component/_media.scss | 9 ++-- src/ui/scss/component/_placeholder.scss | 2 +- src/ui/scss/component/menu-button.scss | 1 - src/ui/scss/init/_mixins.scss | 2 +- static/index.html | 2 +- yarn.lock | 4 +- 33 files changed, 236 insertions(+), 110 deletions(-) rename src/ui/component/{claimListItem/index.js => claimPreview/index.js~HEAD} (100%) rename src/ui/scss/component/{_file-list.scss => _claim-list.scss} (88%) diff --git a/package.json b/package.json index 09f4dae56..c8fac43ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.33.1", + "version": "0.33.2", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "keywords": [ "lbry" @@ -123,7 +123,7 @@ "jsmediatags": "^3.8.1", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#141593500693a93db74c62ef5a9fe67b43896603", + "lbry-redux": "lbryio/lbry-redux#2930ad82a90ca91f6caf3761597ef9a67da7db66", "lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845", "lint-staged": "^7.0.2", "localforage": "^1.7.1", diff --git a/src/ui/component/app/index.js b/src/ui/component/app/index.js index e0c6274dc..8e1482f5e 100644 --- a/src/ui/component/app/index.js +++ b/src/ui/component/app/index.js @@ -1,6 +1,6 @@ import { hot } from 'react-hot-loader/root'; import { connect } from 'react-redux'; -import { doUpdateBlockHeight, doError } from 'lbry-redux'; +import { doUpdateBlockHeight, doError, doFetchTransactions } from 'lbry-redux'; import { selectUser, doRewardList, doFetchRewardedContent } from 'lbryinc'; import { selectThemePath } from 'redux/selectors/settings'; import App from './view'; @@ -15,6 +15,7 @@ const perform = dispatch => ({ updateBlockHeight: () => dispatch(doUpdateBlockHeight()), fetchRewards: () => dispatch(doRewardList()), fetchRewardedContent: () => dispatch(doFetchRewardedContent()), + fetchTransactions: () => dispatch(doFetchTransactions()), }); export default hot( diff --git a/src/ui/component/app/view.jsx b/src/ui/component/app/view.jsx index c59f0054e..0c82d2233 100644 --- a/src/ui/component/app/view.jsx +++ b/src/ui/component/app/view.jsx @@ -9,6 +9,8 @@ import { openContextMenu } from 'util/context-menu'; import useKonamiListener from 'util/enhanced-layout'; import Yrbl from 'component/yrbl'; +export const MAIN_WRAPPER_CLASS = 'main-wrapper'; + type Props = { alertError: (string | {}) => void, pageTitle: ?string, @@ -16,18 +18,23 @@ type Props = { theme: string, fetchRewards: () => void, fetchRewardedContent: () => void, + fetchTransactions: () => void, }; function App(props: Props) { - const { theme, fetchRewards, fetchRewardedContent } = props; + const { theme, fetchRewards, fetchRewardedContent, fetchTransactions } = props; const appRef = useRef(); const isEnhancedLayout = useKonamiListener(); useEffect(() => { ReactModal.setAppElement(appRef.current); - fetchRewards(); fetchRewardedContent(); - }, [fetchRewards, fetchRewardedContent]); + + // @if TARGET='app' + fetchRewards(); + fetchTransactions(); + // @endif + }, [fetchRewards, fetchRewardedContent, fetchTransactions]); useEffect(() => { // $FlowFixMe @@ -38,7 +45,7 @@ function App(props: Props) {
openContextMenu(e)}>
-
+
diff --git a/src/ui/component/channelContent/view.jsx b/src/ui/component/channelContent/view.jsx index 309664b70..7f0e5f27b 100644 --- a/src/ui/component/channelContent/view.jsx +++ b/src/ui/component/channelContent/view.jsx @@ -35,7 +35,7 @@ function ChannelContent(props: Props) { {!channelIsMine && } - {hasContent && claim.permanent_url)} />} + {hasContent && claim.permanent_url).reverse()} />} fetchClaims(uri, page)} diff --git a/src/ui/component/claimList/view.jsx b/src/ui/component/claimList/view.jsx index 3c74c2fdb..31bf67930 100644 --- a/src/ui/component/claimList/view.jsx +++ b/src/ui/component/claimList/view.jsx @@ -1,6 +1,7 @@ // @flow +import { MAIN_WRAPPER_CLASS } from 'component/app/view'; import type { Node } from 'react'; -import React from 'react'; +import React, { useEffect } from 'react'; import classnames from 'classnames'; import ClaimPreview from 'component/claimPreview'; import Spinner from 'component/spinner'; @@ -19,14 +20,25 @@ type Props = { type: string, empty?: string, meta?: Node, + onScrollBottom?: any => void, // If using the default header, this is a unique ID needed to persist the state of the filter setting persistedStorageKey?: string, }; export default function ClaimList(props: Props) { - const { uris, headerAltControls, injectedItem, loading, persistedStorageKey, empty, meta, type, header } = props; + const { + uris, + headerAltControls, + injectedItem, + loading, + persistedStorageKey, + empty, + meta, + type, + header, + onScrollBottom, + } = props; const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW); - const sortedUris = uris && currentSort === SORT_NEW ? uris.slice().reverse() : uris; const hasUris = uris && !!uris.length; const sortedUris = (hasUris && (currentSort === SORT_NEW ? uris : uris.slice().reverse())) || []; @@ -34,8 +46,31 @@ export default function ClaimList(props: Props) { setCurrentSort(currentSort === SORT_NEW ? SORT_OLD : SORT_NEW); } + useEffect(() => { + if (onScrollBottom) { + window.addEventListener('scroll', handleScroll); + + return () => { + window.removeEventListener('scroll', handleScroll); + }; + } + }, [loading, handleScroll]); + + function handleScroll(e) { + if (onScrollBottom) { + const x = document.querySelector(`.${MAIN_WRAPPER_CLASS}`); + + if (x && window.scrollY + window.innerHeight >= x.offsetHeight) { + // fix this + if (!loading && uris.length > 19) { + onScrollBottom(); + } + } + } + } + return ( -
+
{header !== false && (
{header || ( @@ -60,7 +95,7 @@ export default function ClaimList(props: Props) { {sortedUris.map((uri, index) => ( - {index === 4 && injectedItem &&
  • {injectedItem}
  • } + {index === 4 && injectedItem &&
  • {injectedItem}
  • }
    ))} diff --git a/src/ui/component/claimListDiscover/view.jsx b/src/ui/component/claimListDiscover/view.jsx index 331b4389a..309b49c2a 100644 --- a/src/ui/component/claimListDiscover/view.jsx +++ b/src/ui/component/claimListDiscover/view.jsx @@ -1,12 +1,14 @@ // @flow import type { Node } from 'react'; -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import moment from 'moment'; +import usePersistedState from 'util/use-persisted-state'; import { FormField } from 'component/common/form'; import ClaimList from 'component/claimList'; import Tag from 'component/tag'; -import usePersistedState from 'util/use-persisted-state'; +import ClaimPreview from 'component/claimPreview'; +const PAGE_SIZE = 20; const TIME_DAY = 'day'; const TIME_WEEK = 'week'; const TIME_MONTH = 'month'; @@ -37,11 +39,17 @@ function ClaimListDiscover(props: Props) { const [personalSort, setPersonalSort] = usePersistedState('file-list-trending:personalSort', SEARCH_SORT_YOU); const [typeSort, setTypeSort] = usePersistedState('file-list-trending:typeSort', TYPE_TRENDING); const [timeSort, setTimeSort] = usePersistedState('file-list-trending:timeSort', TIME_WEEK); + const [page, setPage] = useState(1); const toCapitalCase = string => string.charAt(0).toUpperCase() + string.slice(1); const tagsString = tags.join(','); useEffect(() => { - const options = {}; + const options: { + page_size: number, + any_tags?: Array, + order_by?: Array, + release_time?: string, + } = { page_size: PAGE_SIZE, page }; const newTags = tagsString.split(','); if ((newTags && !personal) || (newTags && personal && personalSort === SEARCH_SORT_YOU)) { @@ -65,7 +73,7 @@ function ClaimListDiscover(props: Props) { } doClaimSearch(20, options); - }, [personal, personalSort, typeSort, timeSort, doClaimSearch, tagsString]); + }, [personal, personalSort, typeSort, timeSort, doClaimSearch, page, tagsString]); const header = (

    @@ -91,7 +99,10 @@ function ClaimListDiscover(props: Props) { name="trending_overview" className="claim-list__dropdown" value={personalSort} - onChange={e => setPersonalSort(e.target.value)} + onChange={e => { + setPage(1); + setPersonalSort(e.target.value); + }} > {SEARCH_FILTER_TYPES.map(type => (

    ); } diff --git a/src/ui/component/claimListItem/index.js b/src/ui/component/claimPreview/index.js~HEAD similarity index 100% rename from src/ui/component/claimListItem/index.js rename to src/ui/component/claimPreview/index.js~HEAD diff --git a/src/ui/component/claimPreview/view.jsx b/src/ui/component/claimPreview/view.jsx index e5b7ac57c..9eeeaaa1a 100644 --- a/src/ui/component/claimPreview/view.jsx +++ b/src/ui/component/claimPreview/view.jsx @@ -1,7 +1,7 @@ // @flow import React, { useEffect } from 'react'; import classnames from 'classnames'; -import { convertToShareLink } from 'lbry-redux'; +import { parseURI, convertToShareLink } from 'lbry-redux'; import { withRouter } from 'react-router-dom'; import { openCopyLinkMenu } from 'util/context-menu'; import { formatLbryUriForWeb } from 'util/uri'; @@ -53,8 +53,8 @@ function ClaimPreview(props: Props) { blackListedOutpoints, } = props; const haventFetched = claim === undefined; - const abandoned = !isResolvingUri && !claim; - const isChannel = claim && claim.value_type === 'channel'; + const abandoned = !isResolvingUri && !claim && !placeholder; + const { isChannel } = parseURI(uri); const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0; let shouldHide = abandoned || (!claimIsMine && obscureNsfw && nsfw); @@ -94,10 +94,10 @@ function ClaimPreview(props: Props) { if (placeholder && !claim) { return ( -
  • +
  • -
    +
  • @@ -109,15 +109,15 @@ function ClaimPreview(props: Props) { role="link" onClick={pending ? undefined : onClick} onContextMenu={handleContextMenu} - className={classnames('claim-list__item', { - 'claim-list__item--large': type === 'large', + className={classnames('claim-preview', { + 'claim-preview--large': type === 'large', 'claim-list__pending': pending, })} > {isChannel ? : } -
    -
    -
    +
    +
    +
    {type !== 'small' && ( @@ -128,7 +128,7 @@ function ClaimPreview(props: Props) { )}
    -
    +
    {pending &&
    Pending...
    } diff --git a/src/ui/component/common/icon-custom.jsx b/src/ui/component/common/icon-custom.jsx index a1c696832..1208017b9 100644 --- a/src/ui/component/common/icon-custom.jsx +++ b/src/ui/component/common/icon-custom.jsx @@ -40,6 +40,12 @@ export const icons = { ), + [ICONS.FEATURED]: buildIcon( + + + + + ), [ICONS.ARROW_LEFT]: buildIcon( @@ -210,4 +216,12 @@ export const icons = { [ICONS.CHAT]: buildIcon( ), + [ICONS.YES]: buildIcon( + + ), + [ICONS.NO]: buildIcon( + + ), + [ICONS.UP]: buildIcon(), + [ICONS.DOWN]: buildIcon(), }; diff --git a/src/ui/component/fileDetails/view.jsx b/src/ui/component/fileDetails/view.jsx index 38e4a46e0..fcf4d89ee 100644 --- a/src/ui/component/fileDetails/view.jsx +++ b/src/ui/component/fileDetails/view.jsx @@ -42,7 +42,6 @@ class FileDetails extends PureComponent { {description && ( -
    About
    diff --git a/src/ui/component/fileProperties/index.js b/src/ui/component/fileProperties/index.js index 1d6180a04..2223935a2 100644 --- a/src/ui/component/fileProperties/index.js +++ b/src/ui/component/fileProperties/index.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import { makeSelectFileInfoForUri, makeSelectClaimIsMine } from 'lbry-redux'; +import { makeSelectFileInfoForUri, makeSelectClaimIsMine, makeSelectClaimForUri } from 'lbry-redux'; import { selectRewardContentClaimIds } from 'lbryinc'; import { makeSelectIsSubscribed, makeSelectIsNew } from 'redux/selectors/subscriptions'; import FileProperties from './view'; @@ -10,6 +10,7 @@ const select = (state, props) => ({ isSubscribed: makeSelectIsSubscribed(props.uri)(state), isNew: makeSelectIsNew(props.uri)(state), claimIsMine: makeSelectClaimIsMine(props.uri)(state), + claim: makeSelectClaimForUri(props.uri)(state), }); export default connect( diff --git a/src/ui/component/fileProperties/view.jsx b/src/ui/component/fileProperties/view.jsx index b3e3e41eb..f52b0b9db 100644 --- a/src/ui/component/fileProperties/view.jsx +++ b/src/ui/component/fileProperties/view.jsx @@ -7,6 +7,7 @@ import FilePrice from 'component/filePrice'; type Props = { uri: string, + claim: ?StreamClaim, downloaded: boolean, claimIsMine: boolean, isSubscribed: boolean, @@ -15,16 +16,32 @@ type Props = { }; export default function FileProperties(props: Props) { - const { uri, downloaded, claimIsMine, rewardedContentClaimIds, isSubscribed } = props; + const { claim, uri, downloaded, claimIsMine, rewardedContentClaimIds, isSubscribed } = props; const { claimId } = parseURI(uri); const isRewardContent = rewardedContentClaimIds.includes(claimId); + const video = claim && claim.value && claim.value.video; + let duration; + if (video && video.duration) { + // $FlowFixMe + let date = new Date(null); + date.setSeconds(video.duration); + let timeString = date.toISOString().substr(11, 8); + + if (timeString.startsWith('00:')) { + timeString = timeString.substr(3); + } + + duration = timeString; + } + return (
    {isSubscribed && } {!claimIsMine && downloaded && } {isRewardContent && } + {duration && {duration}}
    ); } diff --git a/src/ui/component/fileRender/view.jsx b/src/ui/component/fileRender/view.jsx index 94c6adc4f..d2e40ba77 100644 --- a/src/ui/component/fileRender/view.jsx +++ b/src/ui/component/fileRender/view.jsx @@ -1,12 +1,18 @@ // @flow import { remote } from 'electron'; -import React from 'react'; +import React, { Suspense } from 'react'; import LoadingScreen from 'component/common/loading-screen'; import VideoViewer from 'component/viewers/videoViewer'; // Audio player on hold until the current player is dropped // This component is half working // const AudioViewer = React.lazy<*>(() => +// import( +// /* webpackChunkName: "audioViewer" */ +// 'component/viewers/audioViewer' +// ) +// ); +// const AudioViewer = React.lazy<*>(() => // import(/* webpackChunkName: "audioViewer" */ // 'component/viewers/audioViewer') // ); diff --git a/src/ui/component/tagsSearch/view.jsx b/src/ui/component/tagsSearch/view.jsx index dd27389b1..50674ca59 100644 --- a/src/ui/component/tagsSearch/view.jsx +++ b/src/ui/component/tagsSearch/view.jsx @@ -56,7 +56,7 @@ export default function TagSelect(props: Props) { if (onSelect) { onSelect(tag); } else { - doToggleTagFollow(tag); + doToggleTagFollow(tag.name); } } diff --git a/src/ui/component/transactionListRecent/view.jsx b/src/ui/component/transactionListRecent/view.jsx index 97ae378b7..7932a2851 100644 --- a/src/ui/component/transactionListRecent/view.jsx +++ b/src/ui/component/transactionListRecent/view.jsx @@ -14,8 +14,10 @@ class TransactionListRecent extends React.PureComponent { componentDidMount() { const { fetchMyClaims, fetchTransactions } = this.props; + // @if TARGET='app' fetchMyClaims(); fetchTransactions(); + // @endif } render() { diff --git a/src/ui/component/userEmail/view.jsx b/src/ui/component/userEmail/view.jsx index 81f9a55f6..a296f9dd0 100644 --- a/src/ui/component/userEmail/view.jsx +++ b/src/ui/component/userEmail/view.jsx @@ -4,6 +4,7 @@ import Button from 'component/button'; import { FormField } from 'component/common/form'; import UserEmailNew from 'component/userEmailNew'; import UserEmailVerify from 'component/userEmailVerify'; +import cookie from 'cookie'; type Props = { cancelButton: React.Node, @@ -22,6 +23,15 @@ function UserEmail(props: Props) { isVerified = user.has_verified_email; } + const buttonsProps = IS_WEB + ? { + onClick: () => { + document.cookie = cookie.serialize('auth_token', ''); + window.location.reload(); + }, + } + : { href: 'https://lbry.com/faq/how-to-change-email' }; + return (
    {!email && } @@ -43,9 +53,7 @@ function UserEmail(props: Props) { readOnly label={__('Your Email')} value={email} - inputButton={ -
    diff --git a/src/ui/page/wallet/view.jsx b/src/ui/page/wallet/view.jsx index c93b3a2c9..4708accdf 100644 --- a/src/ui/page/wallet/view.jsx +++ b/src/ui/page/wallet/view.jsx @@ -4,13 +4,17 @@ import WalletSend from 'component/walletSend'; import WalletAddress from 'component/walletAddress'; import TransactionListRecent from 'component/transactionListRecent'; import Page from 'component/page'; +import UnsupportedOnWeb from 'component/common/unsupported-on-web'; const WalletPage = () => ( - - - - + {IS_WEB && } +
    + + + + +
    ); diff --git a/src/ui/scss/all.scss b/src/ui/scss/all.scss index 298ff8ac5..a1125b590 100644 --- a/src/ui/scss/all.scss +++ b/src/ui/scss/all.scss @@ -13,13 +13,13 @@ @import 'component/button'; @import 'component/card'; @import 'component/channel'; +@import 'component/claim-list'; @import 'component/comments'; @import 'component/content'; @import 'component/credit'; @import 'component/dat-gui'; @import 'component/expandable'; @import 'component/file-download'; -@import 'component/file-list'; @import 'component/file-properties'; @import 'component/file-render'; @import 'component/form-field'; diff --git a/src/ui/scss/component/_channel.scss b/src/ui/scss/component/_channel.scss index 39aefb157..f9cb60c81 100644 --- a/src/ui/scss/component/_channel.scss +++ b/src/ui/scss/component/_channel.scss @@ -16,7 +16,7 @@ $metadata-z-index: 1; align-self: flex-start; position: absolute; object-fit: cover; - filter: brightness(60%); + filter: brightness(50%); } .channel-cover, @@ -27,8 +27,8 @@ $metadata-z-index: 1; .channel-thumbnail { display: flex; - height: 5.3rem; - width: 5.4rem; + height: 5rem; + width: 6rem; background-size: cover; margin-right: var(--spacing-medium); } @@ -52,7 +52,6 @@ $metadata-z-index: 1; margin-left: auto; margin-right: auto; align-self: flex-end; - // margin-bottom: -1px; } .channel-thumbnail, diff --git a/src/ui/scss/component/_file-list.scss b/src/ui/scss/component/_claim-list.scss similarity index 88% rename from src/ui/scss/component/_file-list.scss rename to src/ui/scss/component/_claim-list.scss index 0620bbc2f..0455ab805 100644 --- a/src/ui/scss/component/_file-list.scss +++ b/src/ui/scss/component/_claim-list.scss @@ -43,6 +43,7 @@ background-size: 1.2rem; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 96 96' xmlns='http://www.w3.org/2000/svg' fill='%23ffffff'%3E%3Cpath d='M17.172, 31.172c1.562, -1.562 4.095, -1.562 5.656, 0l25.172, 25.171l25.172, -25.171c1.562, -1.562 4.095, -1.562 5.656, 0c1.562, 1.562 1.562, 4.095 0, 5.656l-28, 28c-1.562, 1.562 -4.095, 1.562 -5.656, 0l-28, -28c-0.781, -0.781 -1.172, -1.805 -1.172, -2.828c0, -1.023 0.391, -2.047 1.172, -2.828Z'/%3E%3C/svg%3E%0A"); height: 2.5rem; + font-size: 1.3rem; padding: 0 var(--spacing-medium); padding-right: var(--spacing-large); margin-bottom: 0; @@ -60,16 +61,6 @@ } } -.claim-list__header-text { - display: flex; - align-items: center; -} - -.claim-list__header-text, -.claim-list__dropdown { - font-size: 1.3rem; -} - .claim-list__alt-controls { display: flex; align-items: center; @@ -81,7 +72,7 @@ } } -.claim-list__item { +.claim-preview { display: flex; position: relative; font-size: 1.3rem; @@ -104,12 +95,12 @@ } } -.claim-list__item--injected, -.claim-list__item + .claim-list__item { +.claim-preview--injected, +.claim-preview { border-top: 1px solid rgba($lbry-teal-5, 0.1); } -.claim-list__item--large { +.claim-preview--large { @include mediaThumbHoverZoom; font-size: 1.6rem; border-bottom: 0; @@ -138,32 +129,32 @@ } } -.claim-list__item-metadata { +.claim-preview-metadata { display: flex; flex-direction: column; width: 100%; } -.claim-list__item-info { +.claim-preview-info { align-items: flex-start; } -.claim-list__item-info, -.claim-list__item-properties { +.claim-preview-info, +.claim-preview-properties { display: flex; justify-content: space-between; } -.claim-list__item-properties { +.claim-preview-properties { align-items: flex-end; } -.claim-list__item-title { +.claim-preview-title { font-weight: 600; margin-right: auto; } -.claim-list__item-tags { +.claim-preview-tags { margin-left: 0; } diff --git a/src/ui/scss/component/_file-properties.scss b/src/ui/scss/component/_file-properties.scss index c1821ff89..77dc7dcce 100644 --- a/src/ui/scss/component/_file-properties.scss +++ b/src/ui/scss/component/_file-properties.scss @@ -3,6 +3,14 @@ position: relative; align-items: center; + .icon { + stroke: rgba($lbry-black, 0.5); + + html[data-mode='dark'] & { + stroke: rgba($lbry-white, 0.7); + } + } + & > *:not(:last-child) { margin-right: var(--spacing-small); } diff --git a/src/ui/scss/component/_media.scss b/src/ui/scss/component/_media.scss index 32b310665..bd0724649 100644 --- a/src/ui/scss/component/_media.scss +++ b/src/ui/scss/component/_media.scss @@ -132,10 +132,6 @@ color: rgba($lbry-black, 0.8); font-size: 0.9em; - &:not(:last-child) { - margin-bottom: var(--spacing-medium); - } - html[data-mode='dark'] & { color: rgba($lbry-white, 0.7); } @@ -150,7 +146,7 @@ .media__subtitle { font-size: 0.8em; - color: rgba($lbry-black, 0.8); + color: rgba($lbry-black, 0.6); [data-mode='dark'] & { color: rgba($lbry-white, 0.8); @@ -167,6 +163,7 @@ .media__subtitle__channel { font-weight: 600; + margin: var(--spacing-small) 0; } // M E D I A @@ -181,7 +178,7 @@ } .media__info--large { - border-top: 1px solid $lbry-gray-1; + // border-top: 1px solid $lbry-gray-1; margin-top: var(--spacing-medium); html[data-mode='dark'] & { diff --git a/src/ui/scss/component/_placeholder.scss b/src/ui/scss/component/_placeholder.scss index 3933c5a12..b86928c38 100644 --- a/src/ui/scss/component/_placeholder.scss +++ b/src/ui/scss/component/_placeholder.scss @@ -9,7 +9,7 @@ .placeholder { display: flex; - &.claim-list__item-title { + &.claim-preview-title { width: 100%; height: 3rem; } diff --git a/src/ui/scss/component/menu-button.scss b/src/ui/scss/component/menu-button.scss index 1e86bbdef..7190e030f 100644 --- a/src/ui/scss/component/menu-button.scss +++ b/src/ui/scss/component/menu-button.scss @@ -90,7 +90,6 @@ .icon { margin-right: var(--spacing-small); - margin-bottom: 0.2rem; stroke: $lbry-gray-5; } diff --git a/src/ui/scss/init/_mixins.scss b/src/ui/scss/init/_mixins.scss index d70404d53..a5a6e3e62 100644 --- a/src/ui/scss/init/_mixins.scss +++ b/src/ui/scss/init/_mixins.scss @@ -1,6 +1,6 @@ @mixin placeholder { animation: pulse 2s infinite ease-in-out; - background-color: $lbry-gray-2; + background-color: $lbry-gray-1; border-radius: var(--card-radius); } diff --git a/static/index.html b/static/index.html index d61e7ba15..0a606a2ba 100644 --- a/static/index.html +++ b/static/index.html @@ -12,7 +12,7 @@ - + diff --git a/yarn.lock b/yarn.lock index 4c9cc8945..fe00409d7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6641,9 +6641,9 @@ lazy-val@^1.0.3, lazy-val@^1.0.4: yargs "^13.2.2" zstd-codec "^0.1.1" -lbry-redux@lbryio/lbry-redux#b3bf3f6d53410ff1c5415b51ca425341e364959f: +lbry-redux@lbryio/lbry-redux#2930ad82a90ca91f6caf3761597ef9a67da7db66: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/b3bf3f6d53410ff1c5415b51ca425341e364959f" + resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/2930ad82a90ca91f6caf3761597ef9a67da7db66" dependencies: proxy-polyfill "0.1.6" reselect "^3.0.0" From c6412eebef509b62b8367f9ab2fd2bbb641fe643 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 27 Jun 2019 16:27:38 -0400 Subject: [PATCH 08/21] cleanup --- package.json | 2 +- src/ui/component/fileProperties/index.js | 3 +-- src/ui/component/fileProperties/view.jsx | 21 +++-------------- src/ui/component/publishName/index.js | 1 + src/ui/component/publishName/view.jsx | 5 ++-- src/ui/component/publishPrice/index.js | 7 +++++- src/ui/component/rewardTotal/view.jsx | 2 +- src/ui/component/tag/view.jsx | 1 + src/ui/component/tagsSearch/view.jsx | 23 +++++++++++------- src/ui/component/videoDuration/index.js | 12 ++++++++++ src/ui/component/videoDuration/view.jsx | 30 ++++++++++++++++++++++++ src/ui/page/account/view.jsx | 4 +--- src/ui/page/file/view.jsx | 18 ++------------ src/ui/scss/component/_button.scss | 13 +++++++--- src/ui/scss/component/_claim-list.scss | 5 ++-- src/ui/scss/component/_form-field.scss | 20 ---------------- src/ui/scss/component/_media.scss | 1 + src/ui/scss/component/_tags.scss | 4 ++++ src/ui/scss/init/_mixins.scss | 4 ++++ yarn.lock | 8 +++---- 20 files changed, 101 insertions(+), 83 deletions(-) create mode 100644 src/ui/component/videoDuration/index.js create mode 100644 src/ui/component/videoDuration/view.jsx diff --git a/package.json b/package.json index c8fac43ea..f4f342a01 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@exponent/electron-cookies": "^2.0.0", "@hot-loader/react-dom": "16.8", "@lbry/color": "^1.0.2", - "@lbry/components": "^2.7.2", + "@lbry/components": "^2.7.4", "@reach/rect": "^0.2.1", "@reach/tabs": "^0.1.5", "@reach/tooltip": "^0.2.1", diff --git a/src/ui/component/fileProperties/index.js b/src/ui/component/fileProperties/index.js index 2223935a2..1d6180a04 100644 --- a/src/ui/component/fileProperties/index.js +++ b/src/ui/component/fileProperties/index.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import { makeSelectFileInfoForUri, makeSelectClaimIsMine, makeSelectClaimForUri } from 'lbry-redux'; +import { makeSelectFileInfoForUri, makeSelectClaimIsMine } from 'lbry-redux'; import { selectRewardContentClaimIds } from 'lbryinc'; import { makeSelectIsSubscribed, makeSelectIsNew } from 'redux/selectors/subscriptions'; import FileProperties from './view'; @@ -10,7 +10,6 @@ const select = (state, props) => ({ isSubscribed: makeSelectIsSubscribed(props.uri)(state), isNew: makeSelectIsNew(props.uri)(state), claimIsMine: makeSelectClaimIsMine(props.uri)(state), - claim: makeSelectClaimForUri(props.uri)(state), }); export default connect( diff --git a/src/ui/component/fileProperties/view.jsx b/src/ui/component/fileProperties/view.jsx index f52b0b9db..15783e8a3 100644 --- a/src/ui/component/fileProperties/view.jsx +++ b/src/ui/component/fileProperties/view.jsx @@ -4,10 +4,10 @@ import * as React from 'react'; import { parseURI } from 'lbry-redux'; import Icon from 'component/common/icon'; import FilePrice from 'component/filePrice'; +import VideoDuration from 'component/videoDuration'; type Props = { uri: string, - claim: ?StreamClaim, downloaded: boolean, claimIsMine: boolean, isSubscribed: boolean, @@ -16,32 +16,17 @@ type Props = { }; export default function FileProperties(props: Props) { - const { claim, uri, downloaded, claimIsMine, rewardedContentClaimIds, isSubscribed } = props; + const { uri, downloaded, claimIsMine, rewardedContentClaimIds, isSubscribed } = props; const { claimId } = parseURI(uri); const isRewardContent = rewardedContentClaimIds.includes(claimId); - const video = claim && claim.value && claim.value.video; - let duration; - if (video && video.duration) { - // $FlowFixMe - let date = new Date(null); - date.setSeconds(video.duration); - let timeString = date.toISOString().substr(11, 8); - - if (timeString.startsWith('00:')) { - timeString = timeString.substr(3); - } - - duration = timeString; - } - return (
    {isSubscribed && } {!claimIsMine && downloaded && } {isRewardContent && } - {duration && {duration}} +
    ); } diff --git a/src/ui/component/publishName/index.js b/src/ui/component/publishName/index.js index 7512cddac..ef6ca56da 100644 --- a/src/ui/component/publishName/index.js +++ b/src/ui/component/publishName/index.js @@ -15,6 +15,7 @@ const select = state => ({ channel: makeSelectPublishFormValue('channel')(state), bid: makeSelectPublishFormValue('bid')(state), uri: makeSelectPublishFormValue('uri')(state), + bid: makeSelectPublishFormValue('bid')(state), isStillEditing: selectIsStillEditing(state), isResolvingUri: selectIsResolvingPublishUris(state), amountNeededForTakeover: selectTakeOverAmount(state), diff --git a/src/ui/component/publishName/view.jsx b/src/ui/component/publishName/view.jsx index e53aff865..ee03f8f0a 100644 --- a/src/ui/component/publishName/view.jsx +++ b/src/ui/component/publishName/view.jsx @@ -10,7 +10,7 @@ type Props = { name: string, channel: string, uri: string, - bid: string, + bid: number, balance: number, isStillEditing: boolean, myClaimForUri: ?StreamClaim, @@ -27,7 +27,7 @@ function PublishText(props: Props) { uri, isStillEditing, myClaimForUri, - bid: bidString, + bid, isResolvingUri, amountNeededForTakeover, prepareEdit, @@ -37,7 +37,6 @@ function PublishText(props: Props) { const [nameError, setNameError] = useState(undefined); const [bidError, setBidError] = useState(undefined); const previousBidAmount = myClaimForUri && Number(myClaimForUri.amount); - const bid = Number(bidString); function editExistingClaim() { if (myClaimForUri) { diff --git a/src/ui/component/publishPrice/index.js b/src/ui/component/publishPrice/index.js index ffaa82b58..255f02dc1 100644 --- a/src/ui/component/publishPrice/index.js +++ b/src/ui/component/publishPrice/index.js @@ -1,4 +1,5 @@ import { connect } from 'react-redux'; +import { doUpdatePublishForm } from 'redux/actions/publish'; import { makeSelectPublishFormValue } from 'redux/selectors/publish'; import PublishPage from './view'; @@ -7,7 +8,11 @@ const select = state => ({ fee: makeSelectPublishFormValue('fee')(state), }); +const perform = dispatch => ({ + updatePublishForm: values => dispatch(doUpdatePublishForm(values)), +}); + export default connect( select, - null + perform )(PublishPage); diff --git a/src/ui/component/rewardTotal/view.jsx b/src/ui/component/rewardTotal/view.jsx index 9f5c77e80..903be9bc9 100644 --- a/src/ui/component/rewardTotal/view.jsx +++ b/src/ui/component/rewardTotal/view.jsx @@ -10,7 +10,7 @@ type Props = { function RewardTotal(props: Props) { const { rewards } = props; const rewardTotal = rewards.reduce((acc, val) => acc + val.reward_amount, 0); - const total = useTween(rewardTotal * 25); + const total = useTween(rewardTotal * 40); const integer = Math.round(total * rewardTotal); return ( diff --git a/src/ui/component/tag/view.jsx b/src/ui/component/tag/view.jsx index 6aaa2baa0..ea4ba02c6 100644 --- a/src/ui/component/tag/view.jsx +++ b/src/ui/component/tag/view.jsx @@ -20,6 +20,7 @@ export default function Tag(props: Props) {
    )}
    - +
    - -
    diff --git a/src/ui/component/subscribeButton/view.jsx b/src/ui/component/subscribeButton/view.jsx index 776b1de7b..e9c0b266d 100644 --- a/src/ui/component/subscribeButton/view.jsx +++ b/src/ui/component/subscribeButton/view.jsx @@ -1,7 +1,7 @@ // @flow import * as MODALS from 'constants/modal_types'; import * as ICONS from 'constants/icons'; -import React from 'react'; +import React, { useState, useRef, useEffect } from 'react'; import { parseURI } from 'lbry-redux'; import Button from 'component/button'; @@ -32,18 +32,36 @@ export default function SubscribeButton(props: Props) { showSnackBarOnSubscribe, doToast, } = props; - + const buttonRef = useRef(); + const [isHovering, setIsHovering] = useState(false); + const { claimName } = parseURI(uri); const subscriptionHandler = isSubscribed ? doChannelUnsubscribe : doChannelSubscribe; const subscriptionLabel = isSubscribed ? __('Following') : __('Follow'); + const unfollowOverride = isSubscribed && isHovering && __('Unfollow'); - const { claimName } = parseURI(uri); + useEffect(() => { + function handleHover() { + setIsHovering(!isHovering); + } + + const button = buttonRef.current; + if (button) { + button.addEventListener('mouseover', handleHover); + button.addEventListener('mouseleave', handleHover); + return () => { + button.removeEventListener('mouseover', handleHover); + button.removeEventListener('mouseleave', handleHover); + }; + } + }, [buttonRef, isHovering]); return (
    - + diff --git a/src/ui/page/discover/view.jsx b/src/ui/page/discover/view.jsx index 9b7dff33e..04e16ce8d 100644 --- a/src/ui/page/discover/view.jsx +++ b/src/ui/page/discover/view.jsx @@ -10,6 +10,7 @@ type Props = { function DiscoverPage(props: Props) { const { followedTags } = props; + return ( {hasDownloads ? (
    - + {__('Your Library')}} + defaultSort + persistedStorageKey="claim-list-downloaded" + uris={downloadedUris} + loading={fetching} + />
    ) : (
    diff --git a/src/ui/page/fileListPublished/view.jsx b/src/ui/page/fileListPublished/view.jsx index bb98f9c58..0c79f6aac 100644 --- a/src/ui/page/fileListPublished/view.jsx +++ b/src/ui/page/fileListPublished/view.jsx @@ -21,7 +21,14 @@ function FileListPublished(props: Props) { {uris && uris.length ? (
    - + {__('Your Publishes')}} + loading={fetching} + persistedStorageKey="claim-list-published" + uris={uris} + defaultSort + headerAltControls={
    ) : (
    diff --git a/src/ui/page/following/view.jsx b/src/ui/page/following/view.jsx index 31e53c3bc..ae86b84b9 100644 --- a/src/ui/page/following/view.jsx +++ b/src/ui/page/following/view.jsx @@ -14,10 +14,10 @@ function FollowingEditPage(props: Props) { return (
    - +
    - + {__('Channels You Follow')}} uris={channelUris} />
    ); diff --git a/src/ui/page/library/index.js b/src/ui/page/library/index.js new file mode 100644 index 000000000..abb82e5be --- /dev/null +++ b/src/ui/page/library/index.js @@ -0,0 +1,3 @@ +import LibraryPage from './view'; + +export default LibraryPage; diff --git a/src/ui/page/library/view.jsx b/src/ui/page/library/view.jsx new file mode 100644 index 000000000..71bb0bfac --- /dev/null +++ b/src/ui/page/library/view.jsx @@ -0,0 +1,14 @@ +// @flow +import React from 'react'; +import Page from 'component/page'; +import DownloadList from 'page/fileListDownloaded'; + +function LibraryPage() { + return ( + + + + ); +} + +export default LibraryPage; diff --git a/src/ui/page/subscriptions/view.jsx b/src/ui/page/subscriptions/view.jsx index d7f399c64..9fdcbe5b8 100644 --- a/src/ui/page/subscriptions/view.jsx +++ b/src/ui/page/subscriptions/view.jsx @@ -3,6 +3,7 @@ import * as PAGES from 'constants/pages'; import React, { useEffect, useState } from 'react'; import Page from 'component/page'; import ClaimList from 'component/claimList'; +import ClaimPreview from 'component/claimPreview'; import Button from 'component/button'; type Props = { @@ -79,6 +80,7 @@ export default function SubscriptionsPage(props: Props) { uris={viewingSuggestedSubs ? suggestedSubscriptions.map(sub => sub.uri) : uris} onScrollBottom={() => console.log('scroll bottom') || setPage(page + 1)} /> + {loading && page > 1 && new Array(20).fill(1).map((x, i) => )}
    ); diff --git a/src/ui/page/tags/view.jsx b/src/ui/page/tags/view.jsx index e56be12bc..ee912a72c 100644 --- a/src/ui/page/tags/view.jsx +++ b/src/ui/page/tags/view.jsx @@ -32,9 +32,9 @@ function TagsPage(props: Props) { tags={tags} meta={
    -
    +
    @@ -293,8 +290,6 @@ class FilePage extends React.Component {
    -
    -
    {__('Comments')}
    diff --git a/src/ui/page/wallet/view.jsx b/src/ui/page/wallet/view.jsx index 4708accdf..a51edc049 100644 --- a/src/ui/page/wallet/view.jsx +++ b/src/ui/page/wallet/view.jsx @@ -8,7 +8,7 @@ import UnsupportedOnWeb from 'component/common/unsupported-on-web'; const WalletPage = () => ( - {IS_WEB && } +
    diff --git a/src/ui/scss/component/_button.scss b/src/ui/scss/component/_button.scss index 519a0f84f..f0d8f22ca 100644 --- a/src/ui/scss/component/_button.scss +++ b/src/ui/scss/component/_button.scss @@ -19,11 +19,6 @@ } .button--primary { - &:not(:hover) { - // fix this in components repo - background-color: $lbry-teal-4; - } - &:hover { background-color: $lbry-teal-3; } diff --git a/src/ui/scss/component/_file-properties.scss b/src/ui/scss/component/_file-properties.scss index 77dc7dcce..17ed0c04a 100644 --- a/src/ui/scss/component/_file-properties.scss +++ b/src/ui/scss/component/_file-properties.scss @@ -23,7 +23,7 @@ .file-properties--large { flex-wrap: wrap; font-size: 18px; - margin: var(--spacing-small) 0; + margin: var(--spacing-medium) 0; & > * { margin-top: var(--spacing-small); diff --git a/src/ui/scss/component/_media.scss b/src/ui/scss/component/_media.scss index bd72a3620..48c85fc26 100644 --- a/src/ui/scss/component/_media.scss +++ b/src/ui/scss/component/_media.scss @@ -179,7 +179,7 @@ } .media__info--large { - // border-top: 1px solid $lbry-gray-1; + border-top: 1px solid $lbry-gray-1; margin-top: var(--spacing-medium); html[data-mode='dark'] & { diff --git a/static/locales/en.json b/static/locales/en.json index 89c4925f4..2c0f875b0 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -292,7 +292,6 @@ "Comment": "Comment", "Your comment": "Your comment", "Post": "Post", -<<<<<<< HEAD "No modifier provided after separator %s.": "No modifier provided after separator %s.", "Incompatible Daemon": "Incompatible Daemon", "Incompatible daemon running": "Incompatible daemon running", @@ -309,9 +308,6 @@ "Your version is out of date and may be unreliable or insecure.": "Your version is out of date and may be unreliable or insecure.", "Want to know what has changed?": "Want to know what has changed?", "release notes": "release notes", -======= - "You haven't downloaded anything from LBRY yet.": "You haven't downloaded anything from LBRY yet.", ->>>>>>> ca0fd40a... add placeholders to claim previews "Read the FAQ": "Read the FAQ", "Our FAQ answers many common questions.": "Our FAQ answers many common questions.", "Get Live Help": "Get Live Help", From f387f4c01f856bac7e1fa4e3bb3dd6725041bc9d Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 1 Jul 2019 14:51:57 -0400 Subject: [PATCH 20/21] fix: wallet toast link --- src/ui/component/snackBar/view.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ui/component/snackBar/view.jsx b/src/ui/component/snackBar/view.jsx index c1bd875ae..0fdf6eff8 100644 --- a/src/ui/component/snackBar/view.jsx +++ b/src/ui/component/snackBar/view.jsx @@ -51,7 +51,11 @@ class SnackBar extends React.PureComponent {
    {message}
    - {linkText && linkTarget &&
    ); } From 147e914ed82e9e11309e7b8f6ff917d2c003ca5f Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 1 Jul 2019 22:54:11 -0400 Subject: [PATCH 21/21] add pageSize prop to ClaimList --- src/ui/component/claimList/view.jsx | 7 +++-- src/ui/component/claimListDiscover/view.jsx | 1 + static/locales/en.json | 33 +++++++++++++++++++-- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/ui/component/claimList/view.jsx b/src/ui/component/claimList/view.jsx index 859fe9967..46f1877cd 100644 --- a/src/ui/component/claimList/view.jsx +++ b/src/ui/component/claimList/view.jsx @@ -22,6 +22,7 @@ type Props = { defaultSort?: boolean, onScrollBottom?: any => void, page?: number, + pageSize?: number, // If using the default header, this is a unique ID needed to persist the state of the filter setting persistedStorageKey?: string, }; @@ -39,6 +40,7 @@ export default function ClaimList(props: Props) { header, onScrollBottom, page, + pageSize, } = props; const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW); const hasUris = uris && !!uris.length; @@ -51,12 +53,11 @@ export default function ClaimList(props: Props) { const urisLength = uris && uris.length; useEffect(() => { function handleScroll(e) { - if (onScrollBottom) { + if (pageSize && onScrollBottom) { const x = document.querySelector(`.${MAIN_WRAPPER_CLASS}`); if (x && window.scrollY + window.innerHeight >= x.offsetHeight) { - // fix this - if (!loading && urisLength > 19) { + if (!loading && urisLength >= pageSize) { onScrollBottom(); } } diff --git a/src/ui/component/claimListDiscover/view.jsx b/src/ui/component/claimListDiscover/view.jsx index c342c52b1..9a34e40a9 100644 --- a/src/ui/component/claimListDiscover/view.jsx +++ b/src/ui/component/claimListDiscover/view.jsx @@ -156,6 +156,7 @@ function ClaimListDiscover(props: Props) { headerAltControls={meta} onScrollBottom={() => setPage(page + 1)} page={page} + pageSize={PAGE_SIZE} /> {loading && page > 1 && new Array(PAGE_SIZE).fill(1).map((x, i) => )} diff --git a/static/locales/en.json b/static/locales/en.json index 2c0f875b0..d20273247 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -427,5 +427,34 @@ "Error message": "Error message", "Error data": "Error data", "Error": "Error", - "We're sorry that LBRY has encountered an error. This has been reported and we will investigate the problem.": "We're sorry that LBRY has encountered an error. This has been reported and we will investigate the problem." -} + "We're sorry that LBRY has encountered an error. This has been reported and we will investigate the problem.": "We're sorry that LBRY has encountered an error. This has been reported and we will investigate the problem.", + "Customize": "Customize", + "Customize Your Homepage": "Customize Your Homepage", + "Tags You Follow": "Tags You Follow", + "Channels You Follow": "Channels You Follow", + "Everyone": "Everyone", + "This file is downloaded.": "This file is downloaded.", + "Featured content. Earn rewards for watching.": "Featured content. Earn rewards for watching.", + "You are subscribed to this channel.": "You are subscribed to this channel.", + "Remove from your library": "Remove from your library", + "View tag": "View tag", + "Customize Your Tags": "Customize Your Tags", + "Remove tag": "Remove tag", + "Add tag": "Add tag", + "The better your tags are, the easier it will be for people to discover your content.": "The better your tags are, the easier it will be for people to discover your content.", + "No tags added": "No tags added", + "My description for this and that": "My description for this and that", + "Choose a thumbnail": "Choose a thumbnail", + "Take a snapshot from your video": "Take a snapshot from your video", + "Upload your thumbnail to": "Upload your thumbnail to", + "Add a price to this file": "Add a price to this file", + "Additional Options": "Additional Options", + "A URL is required": "A URL is required", + "A name is required": "A name is required", + "The updates will take a few minutes to appear for other LBRY users. Until then it will be listed as \"pending\" under your published files.": "The updates will take a few minutes to appear for other LBRY users. Until then it will be listed as \"pending\" under your published files.", + "Your Publishes": "Your Publishes", + "New Publish": "New Publish", + "Your Library": "Your Library", + "This will appear as a tip for \"Original LBRY porn - Nude Hot Girl masturbates FREE\".": "This will appear as a tip for \"Original LBRY porn - Nude Hot Girl masturbates FREE\".", + "You sent 25 LBC as a tip, Mahalo!": "You sent 25 LBC as a tip, Mahalo!" +} \ No newline at end of file