From efeb5b667294cebb3448e55d51edb8454b7f57ae Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 7 May 2019 21:29:30 -0400 Subject: [PATCH 01/49] style consitency cleanup round is back! --- src/ui/component/channelContent/view.jsx | 1 - src/ui/component/common/paginate.jsx | 11 +++--- src/ui/component/navigationHistory/view.jsx | 6 ++-- .../navigationHistoryRecent/view.jsx | 2 +- src/ui/component/publishForm/view.jsx | 29 +++++++-------- .../internal/transaction-list-item.jsx | 3 +- src/ui/component/transactionList/view.jsx | 3 +- .../component/transactionListRecent/view.jsx | 5 --- src/ui/component/userVerify/view.jsx | 2 +- src/ui/component/walletBalance/view.jsx | 2 +- src/ui/page/settings/view.jsx | 23 ++++++------ src/ui/page/show/view.jsx | 4 +-- src/ui/scss/component/_button.scss | 13 ------- src/ui/scss/component/_card.scss | 13 +++++-- src/ui/scss/component/_form-field.scss | 35 ++++++++++++++++--- src/ui/scss/component/_markdown-editor.scss | 6 ++-- src/ui/scss/component/_media.scss | 14 +++----- src/ui/scss/component/_placeholder.scss | 11 ------ src/ui/scss/component/_search.scss | 6 +--- src/ui/scss/component/_table.scss | 18 +++------- src/ui/scss/init/_gui.scss | 5 +-- src/ui/scss/init/_mixins.scss | 13 +++++++ src/ui/scss/init/_vars.scss | 3 +- 23 files changed, 112 insertions(+), 116 deletions(-) diff --git a/src/ui/component/channelContent/view.jsx b/src/ui/component/channelContent/view.jsx index 83cc3378a..3f129b45a 100644 --- a/src/ui/component/channelContent/view.jsx +++ b/src/ui/component/channelContent/view.jsx @@ -14,7 +14,6 @@ type Props = { claimsInChannel: Array, channelIsMine: boolean, fetchClaims: (string, number) => void, - location: UrlLocation, }; function ChannelContent(props: Props) { diff --git a/src/ui/component/common/paginate.jsx b/src/ui/component/common/paginate.jsx index 7c4635a03..c775ba821 100644 --- a/src/ui/component/common/paginate.jsx +++ b/src/ui/component/common/paginate.jsx @@ -40,12 +40,13 @@ function Paginate(props: Props) { } } - if (totalPages <= 1 || loading) { - return null; - } - return ( -
+ // Hide the paginate controls if we are loading or there is only one page + // This is a little weird but it makes the component + // really nice to work with. It will always handle fetching your data, + // even if the data returned doesn't have more than one page + // fetchStuff(page)} /> + { )} diff --git a/src/ui/component/transactionList/view.jsx b/src/ui/component/transactionList/view.jsx index 05dc7adb3..ae9d63b52 100644 --- a/src/ui/component/transactionList/view.jsx +++ b/src/ui/component/transactionList/view.jsx @@ -2,7 +2,6 @@ import * as icons from 'constants/icons'; import * as MODALS from 'constants/modal_types'; import * as React from 'react'; -import { List } from 'react-virtualized'; import { FormField, Form } from 'component/common/form'; import Button from 'component/button'; import FileExporter from 'component/common/file-exporter'; @@ -103,7 +102,7 @@ class TransactionList extends React.PureComponent { )} - {!transactionList.length &&

{emptyMessage || __('No transactions to list.')}

} + {!transactionList.length &&

{emptyMessage || __('No transactions to list.')}

} {!!transactionList.length && ( diff --git a/src/ui/component/transactionListRecent/view.jsx b/src/ui/component/transactionListRecent/view.jsx index 28e27dc83..da6578aa2 100644 --- a/src/ui/component/transactionListRecent/view.jsx +++ b/src/ui/component/transactionListRecent/view.jsx @@ -31,11 +31,6 @@ class TransactionListRecent extends React.PureComponent { {__('Recent Transactions')} - -

- {__('To view all of your transactions, navigate to the')}{' '} - )} From c1aa7609bac92277b2629275fc97c22c7b5e4120 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Sat, 11 May 2019 15:06:22 -0400 Subject: [PATCH 25/49] add default thumbnail on channel page --- src/ui/component/channelThumbnail/gerbil.png | Bin 0 -> 4697 bytes src/ui/component/channelThumbnail/view.jsx | 35 ++++++++++++++-- src/ui/scss/component/_channel.scss | 41 +++++++++++++------ 3 files changed, 61 insertions(+), 15 deletions(-) create mode 100644 src/ui/component/channelThumbnail/gerbil.png diff --git a/src/ui/component/channelThumbnail/gerbil.png b/src/ui/component/channelThumbnail/gerbil.png new file mode 100644 index 0000000000000000000000000000000000000000..c19e658d2432ce63e8f550d1a64410f65e2b3b9e GIT binary patch literal 4697 zcmV-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IX=!Px z0ym+63Ogh@A-&>OrQTGBN+q9z3E*@KMoqW{3Zt((Drg!Nv>=hZP(urI)fG#1hs5gy@(pLb#m09)%kY%EDR`EU_BZPK0|4m%o>1 zn@U8oi&d8(jrCw5ZgLj!%;UJUz8PLb8}&|?3&9d+&2+MhBRglokD3JrBSB{&Sgmtp zJHfecdF05Ej}gl~?L%22TT)}peSLlXPp0Fr+u?ks2K?MFk`CHFi6Jpxp*wH^*7c;x zk*;>}VtNrfXv4$9m+@dYosr^=R@V<`T^CU=f4+9@+9%=(-ihPr(W4VMeJIh_bbS3!(RbQw%TzqO3x1D%OA zOppm7MDZG>E>@hUb+4K=MWzHm@m8zV({LL&6kL=j;BKJ{u!84!2_dWtu0vRzlG#dU zhYc3uy<{y~6mNSdt2*1?-~SI^eb(*Bd}XIxhhq}0Z!>-r4X7Lhoi6kC9o`G?DV=8_eUGrR+IE!j31dshU2*&N?UBapE-I0R zN|eFXu<2#p>e^@2l5}NB+uT4e$Wg`ML<_-g>&vPNZ?w8fyy-KsCFqoe+$2)q0p$jwmJx$(N$&#k^&2`_za{GCovrsy7I0a_Om$uQb%j=ciq-6sJO zTt^Io4YH!Tfnh(yu_ZKu5^b_Qdu}(DZbAW3g`xyTP@#s84D)a z|H{fr0V7xECGsmUs&;RAd3jy}As9=GPS_g~X+~dYvFnh0+LAKY(H=N( zfaA7rOQb3E^+WP&gAi>p*C2+wwxC+Aj!7V7UbJlX(EODoj)ZLm-|CVCLgq!wjprm< z*>-q46u&m}qJ@>E6?s=8+fi6uT`frfgdkd;N)p))u4D+pug$b*+1%w}<7kb%8-k0F zY0>`h!w<9`6B22QP(ojs7Htyhit*VF2qE;9SVKTdfeAljBH4H2m-|;#?Y7lKj bGR*%0KPS-t(jqfO00000NkvXXu0mjf5mEHC literal 0 HcmV?d00001 diff --git a/src/ui/component/channelThumbnail/view.jsx b/src/ui/component/channelThumbnail/view.jsx index 054f1021e..a22c24613 100644 --- a/src/ui/component/channelThumbnail/view.jsx +++ b/src/ui/component/channelThumbnail/view.jsx @@ -1,15 +1,44 @@ // @flow import React from 'react'; +import { parseURI } from 'lbry-redux'; +import classnames from 'classnames'; +import Gerbil from './gerbil.png'; type Props = { thumbnail: ?string, + uri: string, }; function ChannelThumbnail(props: Props) { - const { thumbnail } = props; + const { thumbnail, uri } = props; + + function getColorClass() { + // Generate a random color class based on the first letter of the channel name + const { channelName } = parseURI(uri); + const initializer = channelName.charCodeAt(0) - 65; // will be between 0 and 57 + + let thumbnailColorClass = `channel-thumbnail__default--`; + + switch (true) { + case initializer < 15: + return (thumbnailColorClass += '1'); + case initializer < 30: + return (thumbnailColorClass += '2'); + case initializer < 45: + return (thumbnailColorClass += '3'); + default: + return (thumbnailColorClass += '4'); + } + } + return ( -

- {thumbnail && } +
+ {!thumbnail && } + {thumbnail && }
); } diff --git a/src/ui/scss/component/_channel.scss b/src/ui/scss/component/_channel.scss index 3552b21c1..20b57902a 100644 --- a/src/ui/scss/component/_channel.scss +++ b/src/ui/scss/component/_channel.scss @@ -14,7 +14,7 @@ $metadata-z-index: 1; align-self: flex-start; position: absolute; object-fit: cover; - filter: brightness(40%); + filter: brightness(60%); } .channel__cover, @@ -23,27 +23,48 @@ $metadata-z-index: 1; width: 100%; } -.channel__thumbnail { +.channel-thumbnail { position: absolute; + display: flex; left: var(--spacing-main-padding); height: var(--channel-thumbnail-size); width: var(--channel-thumbnail-size); - background-color: $lbry-gray-3; - background-image: linear-gradient(to right, $lbry-white, $lbry-gray-3 80%); background-size: cover; box-shadow: 0px 8px 40px -3px $lbry-black; } -.channel__thumbnail--custom { +.channel-thumbnail__custom { width: 100%; object-fit: cover; } -.channel__thumbnail, -.channel__thumbnail--custom { +.channel-thumbnail__default { + width: 80%; + height: 80%; + margin-left: auto; + margin-right: auto; + align-self: flex-end; + margin-bottom: -1px; +} + +.channel-thumbnail, +.channel-thumbnail__custom { border-radius: var(--card-radius); } +.channel-thumbnail__default--1 { + background-color: $lbry-indigo-3; +} +.channel-thumbnail__default--2 { + background-color: $lbry-orange-2; +} +.channel-thumbnail__default--3 { + background-color: $lbry-blue-3; +} +.channel-thumbnail__default--4 { + background-color: $lbry-red-1; +} + .channel__primary-info { // Ensure the profile pic/title sit ontop of the default cover background z-index: $metadata-z-index; @@ -63,9 +84,5 @@ $metadata-z-index: 1; font-size: 1.2rem; user-select: all; margin-top: -0.25rem; + color: rgba($lbry-white, 0.75); } - -// .channel__description { -// font-size: 1.3rem; -// margin: var(--spacing-vertical-large) 0; -// } From 53419d29d21f0b9a602d33cd9dbc294671fb95a8 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Sun, 12 May 2019 00:34:17 -0400 Subject: [PATCH 26/49] fix: show message when a user doesn't have any transactions --- src/ui/component/transactionListRecent/view.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui/component/transactionListRecent/view.jsx b/src/ui/component/transactionListRecent/view.jsx index da6578aa2..fcd979124 100644 --- a/src/ui/component/transactionListRecent/view.jsx +++ b/src/ui/component/transactionListRecent/view.jsx @@ -39,6 +39,12 @@ class TransactionListRecent extends React.PureComponent {
)} + {!fetchingTransactions && !hasTransactions && ( +
+

{__('No transactions... yet.')}

+
+ )} + {hasTransactions && (
From 40a5c4c5f60a421d5518d1bb22d04a51c151f89f Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Sun, 12 May 2019 00:34:43 -0400 Subject: [PATCH 27/49] v0.32.0-rc.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b089763f8..40397ea38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.32.0-rc.2", + "version": "0.32.0-rc.3", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "keywords": [ "lbry" From db67c39ec6b6c285b952a05d53c8003a27718755 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 13 May 2019 02:05:38 -0400 Subject: [PATCH 28/49] styling cleanup --- package.json | 1 - src/ui/component/common/icon.jsx | 2 +- src/ui/component/fileCard/view.jsx | 5 +---- src/ui/component/fileDetails/view.jsx | 1 - src/ui/component/fileTile/view.jsx | 6 +++--- src/ui/component/navigationHistory/view.jsx | 2 +- src/ui/component/sideBar/view.jsx | 20 +++++++++--------- src/ui/page/channel/view.jsx | 4 ++-- src/ui/page/search/view.jsx | 1 - src/ui/scss/component/_card.scss | 14 ++++++------- src/ui/scss/component/_channel.scss | 8 +++---- src/ui/scss/component/_item-list.scss | 1 - src/ui/scss/component/_search.scss | 7 +------ src/ui/scss/component/_table.scss | 13 ++++++++---- src/ui/scss/init/_vars.scss | 2 +- yarn.lock | 23 ++------------------- 16 files changed, 42 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index 40397ea38..67c7c5611 100644 --- a/package.json +++ b/package.json @@ -151,7 +151,6 @@ "react-router-dom": "^5.0.0", "react-simplemde-editor": "^4.0.0", "react-toggle": "^4.0.2", - "react-virtualized": "^9.21.0", "redux": "^3.6.0", "redux-persist": "^4.8.0", "redux-persist-transform-compress": "^4.2.0", diff --git a/src/ui/component/common/icon.jsx b/src/ui/component/common/icon.jsx index 79b2365ef..fc13a5851 100644 --- a/src/ui/component/common/icon.jsx +++ b/src/ui/component/common/icon.jsx @@ -25,7 +25,7 @@ class IconComponent extends React.PureComponent { switch (icon) { case ICONS.FEATURED: return __('Featured content. Earn rewards for watching.'); - case ICONS.LOCAL: + case ICONS.DOWNLOAD: return __('This file is downloaded.'); default: return null; diff --git a/src/ui/component/fileCard/view.jsx b/src/ui/component/fileCard/view.jsx index 351d5585e..a2d4e88d7 100644 --- a/src/ui/component/fileCard/view.jsx +++ b/src/ui/component/fileCard/view.jsx @@ -12,7 +12,6 @@ import { openCopyLinkMenu } from 'util/context-menu'; import DateTime from 'component/dateTime'; import { withRouter } from 'react-router-dom'; import { formatLbryUriForWeb } from 'util/uri'; -import get from 'lodash.get'; type Props = { uri: string, @@ -65,7 +64,6 @@ class FileCard extends React.PureComponent { const { claim, fileInfo, - metadata, rewardedContentClaimIds, obscureNsfw, claimIsMine, @@ -106,7 +104,6 @@ class FileCard extends React.PureComponent { const uri = !pending ? normalizeURI(this.props.uri) : this.props.uri; const isRewardContent = claim && rewardedContentClaimIds.includes(claim.claim_id); - const height = claim && claim.height; const handleContextMenu = event => { event.preventDefault(); event.stopPropagation(); @@ -146,7 +143,7 @@ class FileCard extends React.PureComponent { {isRewardContent && } {isSubscribed && } {claimIsMine && } - {!claimIsMine && fileInfo && } + {!claimIsMine && fileInfo && } {isNew && {__('NEW')}}
diff --git a/src/ui/component/fileDetails/view.jsx b/src/ui/component/fileDetails/view.jsx index 2ee12f074..7645d1f9d 100644 --- a/src/ui/component/fileDetails/view.jsx +++ b/src/ui/component/fileDetails/view.jsx @@ -92,7 +92,6 @@ class FileDetails extends PureComponent { {__('Downloaded to')} {': '} {isChannel ? ( diff --git a/src/ui/scss/component/_channel.scss b/src/ui/scss/component/_channel.scss index 0f811d055..a67cf3235 100644 --- a/src/ui/scss/component/_channel.scss +++ b/src/ui/scss/component/_channel.scss @@ -82,7 +82,6 @@ $metadata-z-index: 1; .channel__url { font-size: 1.2rem; - user-select: all; margin-top: -0.25rem; color: rgba($lbry-white, 0.75); } From 4212978dfee389bb12cf7cf24ca8424750746551 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 13 May 2019 02:37:54 -0400 Subject: [PATCH 30/49] update sdk to 0.37.0rc7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 67c7c5611..1960c648f 100644 --- a/package.json +++ b/package.json @@ -187,7 +187,7 @@ "yarn": "^1.3" }, "lbrySettings": { - "lbrynetDaemonVersion": "0.37.0rc6", + "lbrynetDaemonVersion": "0.37.0rc7", "lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip", "lbrynetDaemonDir": "static/daemon", "lbrynetDaemonFileName": "lbrynet" From e3342eb34d0ada4a673902a9f8742f1f7eb687a4 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 13 May 2019 02:43:07 -0400 Subject: [PATCH 31/49] v0.32.0-rc.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1960c648f..5fa221ef2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.32.0-rc.3", + "version": "0.32.0-rc.4", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "keywords": [ "lbry" From 467cbda5c66219200ea6e48547a3cf1d3ebe33fc Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 13 May 2019 22:10:41 -0400 Subject: [PATCH 32/49] add comments pointing to primary defintion of WEBPACK_PORT --- src/platforms/electron/devServer.js | 6 +++--- static/index.dev.html | 4 ++++ webpack.base.config.js | 5 +++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/platforms/electron/devServer.js b/src/platforms/electron/devServer.js index b9d87ae9f..85ef85696 100644 --- a/src/platforms/electron/devServer.js +++ b/src/platforms/electron/devServer.js @@ -5,8 +5,8 @@ const middleware = require('webpack-dev-middleware'); const express = require('express'); const app = express(); -// Ideally this would come from the same source that sets this port in webpack.web.config.js -// but we can't inject a variable into this file because it is not being touched by webpack +// Primary definition for this is in webpack.web.config.js +// We can't access it here because webpack isn't running on this file const WEBPACK_PORT = 9090; console.log( @@ -42,7 +42,7 @@ app.use(renderInstance); app.use(express.static('dist/electron/static')); app.listen(WEBPACK_PORT, () => { - console.log(chalk.yellow.bold('Renderer listening on port 9090 (still compiling)')); + console.log(chalk.yellow.bold(`Renderer listening on port ${WEBPACK_PORT} (still compiling)`)); }); mainInstance.waitUntilValid(() => console.log(chalk.green(`${chalk.underline('main')} compilation complete.`))); diff --git a/static/index.dev.html b/static/index.dev.html index e36d3ec63..88166d44b 100644 --- a/static/index.dev.html +++ b/static/index.dev.html @@ -7,6 +7,10 @@
+ diff --git a/webpack.base.config.js b/webpack.base.config.js index 4610f096b..8d67e6c70 100644 --- a/webpack.base.config.js +++ b/webpack.base.config.js @@ -12,6 +12,11 @@ const { ifProduction } = getIfUtils(NODE_ENV); const UI_ROOT = path.resolve(__dirname, 'src/ui/'); const STATIC_ROOT = path.resolve(__dirname, 'static/'); const DIST_ROOT = path.resolve(__dirname, 'dist/'); + +// There are a two other uses of this value that can't access it from webpack +// They exist in +// src/platforms/electron/devServer.js +// static/index.dev.html const WEBPACK_PORT = 9090; console.log(ifProduction('production', 'development')); From b7f5ebf994814b2833a9eca91573e9b7d14d7a19 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 13 May 2019 22:51:33 -0400 Subject: [PATCH 33/49] move backup page inside of help --- src/ui/component/router/view.jsx | 2 - src/ui/component/sideBar/view.jsx | 5 -- .../walletBackup}/index.js | 4 +- src/ui/component/walletBackup/view.jsx | 66 +++++++++++++++++++ src/ui/page/help/view.jsx | 6 +- 5 files changed, 73 insertions(+), 10 deletions(-) rename src/ui/{page/backup => component/walletBackup}/index.js (69%) create mode 100644 src/ui/component/walletBackup/view.jsx diff --git a/src/ui/component/router/view.jsx b/src/ui/component/router/view.jsx index 47e2fbf86..e60197c1c 100644 --- a/src/ui/component/router/view.jsx +++ b/src/ui/component/router/view.jsx @@ -14,7 +14,6 @@ import FileListPublished from 'page/fileListPublished'; import TransactionHistoryPage from 'page/transactionHistory'; import AuthPage from 'page/auth'; import InvitePage from 'page/invite'; -import BackupPage from 'page/backup'; import SubscriptionsPage from 'page/subscriptions'; import SearchPage from 'page/search'; import UserHistoryPage from 'page/userHistory'; @@ -39,7 +38,6 @@ export default function AppRouter() { - diff --git a/src/ui/component/sideBar/view.jsx b/src/ui/component/sideBar/view.jsx index c055af4b6..01740b4aa 100644 --- a/src/ui/component/sideBar/view.jsx +++ b/src/ui/component/sideBar/view.jsx @@ -91,11 +91,6 @@ class SideBar extends React.PureComponent { { ...buildLink(PAGES.SETTINGS, __('Settings'), ICONS.SETTINGS), }, - // @if TARGET='app' - { - ...buildLink(PAGES.BACKUP, __('Backup'), ICONS.BACKUP), - }, - // @endif ].map(renderLink)} diff --git a/src/ui/page/backup/index.js b/src/ui/component/walletBackup/index.js similarity index 69% rename from src/ui/page/backup/index.js rename to src/ui/component/walletBackup/index.js index df4f971d8..5d0057d8b 100644 --- a/src/ui/page/backup/index.js +++ b/src/ui/component/walletBackup/index.js @@ -1,9 +1,9 @@ import { connect } from 'react-redux'; import { selectDaemonSettings } from 'redux/selectors/settings'; -import BackupPage from './view'; +import WalletBackup from './view'; const select = state => ({ daemonSettings: selectDaemonSettings(state), }); -export default connect(select)(BackupPage); +export default connect(select)(WalletBackup); diff --git a/src/ui/component/walletBackup/view.jsx b/src/ui/component/walletBackup/view.jsx new file mode 100644 index 000000000..322cf0dec --- /dev/null +++ b/src/ui/component/walletBackup/view.jsx @@ -0,0 +1,66 @@ +// @flow +import * as React from 'react'; +import Button from 'component/button'; + +type Props = { + daemonSettings: { + wallet_dir: ?string, + }, +}; + +class WalletBackup extends React.PureComponent { + render() { + const { daemonSettings } = this.props; + const { wallet_dir: lbryumWalletDir } = daemonSettings; + + const noDaemonSettings = Object.keys(daemonSettings).length === 0; + + return ( +
+ {noDaemonSettings ? ( +
+

{__('Failed to load settings.')}

+
+ ) : ( + +
+

{__('Backup Your LBRY Credits')}

+ +

+ {__( + '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.' + )} +

+

+ {__( + 'However, it is fairly easy to back up manually. To backup your wallet, make a copy of the folder listed below:' + )} +

+

{lbryumWalletDir}

+

+ {__( + 'Access to these files are equivalent to having access to your credits. Keep any copies you make of your wallet in a secure place.' + )} +

+

+ For more details on backing up and best practices,{' '} +

+
+ )} +
+ ); + } +} + +export default WalletBackup; diff --git a/src/ui/page/help/view.jsx b/src/ui/page/help/view.jsx index b7fdde058..e71079928 100644 --- a/src/ui/page/help/view.jsx +++ b/src/ui/page/help/view.jsx @@ -2,7 +2,6 @@ // @flow import * as icons from 'constants/icons'; import * as React from 'react'; -import classnames from 'classnames'; // @if TARGET='app' import { shell } from 'electron'; // @endif @@ -10,6 +9,7 @@ import { Lbry } from 'lbry-redux'; import Native from 'native'; import Button from 'component/button'; import Page from 'component/page'; +import BackupSection from 'component/walletBackup'; type DeamonSettings = { data_dir: string | any, @@ -194,6 +194,10 @@ class HelpPage extends React.PureComponent { + {/* @if TARGET='app' */} + + {/* @endif */} +

{__('About')}

From 03ebcd953d88cab229c0cf940a3ea1854950c37f Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 13 May 2019 22:53:04 -0400 Subject: [PATCH 34/49] simplify default channel color creation --- src/ui/component/channelThumbnail/view.jsx | 24 ++----- src/ui/page/backup/view.jsx | 73 ---------------------- src/ui/scss/component/_card.scss | 2 - src/ui/scss/component/_channel.scss | 8 +-- 4 files changed, 9 insertions(+), 98 deletions(-) delete mode 100644 src/ui/page/backup/view.jsx diff --git a/src/ui/component/channelThumbnail/view.jsx b/src/ui/component/channelThumbnail/view.jsx index a22c24613..d52df8292 100644 --- a/src/ui/component/channelThumbnail/view.jsx +++ b/src/ui/component/channelThumbnail/view.jsx @@ -12,29 +12,15 @@ type Props = { function ChannelThumbnail(props: Props) { const { thumbnail, uri } = props; - function getColorClass() { - // Generate a random color class based on the first letter of the channel name - const { channelName } = parseURI(uri); - const initializer = channelName.charCodeAt(0) - 65; // will be between 0 and 57 - - let thumbnailColorClass = `channel-thumbnail__default--`; - - switch (true) { - case initializer < 15: - return (thumbnailColorClass += '1'); - case initializer < 30: - return (thumbnailColorClass += '2'); - case initializer < 45: - return (thumbnailColorClass += '3'); - default: - return (thumbnailColorClass += '4'); - } - } + // Generate a random color class based on the first letter of the channel name + const { channelName } = parseURI(uri); + const initializer = channelName.charCodeAt(0) - 65; // will be between 0 and 57 + const className = `channel-thumbnail__default--${initializer % 4}`; return (
{!thumbnail && } diff --git a/src/ui/page/backup/view.jsx b/src/ui/page/backup/view.jsx deleted file mode 100644 index 4ee11394a..000000000 --- a/src/ui/page/backup/view.jsx +++ /dev/null @@ -1,73 +0,0 @@ -// @flow -import * as React from 'react'; -import Button from 'component/button'; -import Page from 'component/page'; - -type Props = { - daemonSettings: { - wallet_dir: ?string, - }, -}; - -class BackupPage extends React.PureComponent { - render() { - const { daemonSettings } = this.props; - const { wallet_dir: lbryumWalletDir } = daemonSettings; - - const noDaemonSettings = Object.keys(daemonSettings).length === 0; - - return ( - -
- {noDaemonSettings ? ( -
-

{__('Failed to load settings.')}

-
- ) : ( - -
-

{__('Backup Your LBRY Credits')}

- -

- {__( - '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.' - )} -

-

- {__( - 'However, it is fairly easy to back up manually. To backup your wallet, make a copy of the folder listed below:' - )} -

-

{lbryumWalletDir}

-

- {__( - 'Access to these files are equivalent to having access to your credits. Keep any copies you make of your wallet in a secure place.' - )} -

-

- For more details on backing up and best practices,{' '} -

-
- )} -
-
- ); - } -} - -export default BackupPage; diff --git a/src/ui/scss/component/_card.scss b/src/ui/scss/component/_card.scss index 7c8e33f09..ab177228c 100644 --- a/src/ui/scss/component/_card.scss +++ b/src/ui/scss/component/_card.scss @@ -1,6 +1,5 @@ .card { background-color: $lbry-white; - border: 1px solid $lbry-gray-1; margin-bottom: var(--spacing-vertical-xlarge); position: relative; border-radius: var(--card-radius); @@ -8,7 +7,6 @@ html[data-mode='dark'] & { background-color: rgba($lbry-white, 0.1); - border-color: rgba($lbry-white, 0.1); box-shadow: var(--card-box-shadow) darken($lbry-gray-1, 80%); } } diff --git a/src/ui/scss/component/_channel.scss b/src/ui/scss/component/_channel.scss index a67cf3235..fcbadeaf1 100644 --- a/src/ui/scss/component/_channel.scss +++ b/src/ui/scss/component/_channel.scss @@ -52,16 +52,16 @@ $metadata-z-index: 1; border-radius: var(--card-radius); } -.channel-thumbnail__default--1 { +.channel-thumbnail__default--0 { background-color: $lbry-indigo-3; } -.channel-thumbnail__default--2 { +.channel-thumbnail__default--1 { background-color: $lbry-orange-2; } -.channel-thumbnail__default--3 { +.channel-thumbnail__default--2 { background-color: $lbry-blue-3; } -.channel-thumbnail__default--4 { +.channel-thumbnail__default--3 { background-color: $lbry-red-1; } From a8cacd13ae8906973c8ca4f707a3d6562be4ac5f Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 00:52:51 -0400 Subject: [PATCH 35/49] use supportsByOutpoint --- package.json | 2 +- src/ui/component/transactionList/index.js | 4 ++-- src/ui/component/transactionList/view.jsx | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5fa221ef2..0ccb87c14 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "jsmediatags": "^3.8.1", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#c8126ab21792d7a85e1123a2363af285a0263654", + "lbry-redux": "lbryio/lbry-redux#02f6918238110726c0b3b4248c61a84ac0b969e3", "lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845", "lint-staged": "^7.0.2", "localforage": "^1.7.1", diff --git a/src/ui/component/transactionList/index.js b/src/ui/component/transactionList/index.js index c47ed970d..102a7858e 100644 --- a/src/ui/component/transactionList/index.js +++ b/src/ui/component/transactionList/index.js @@ -3,7 +3,7 @@ import { selectClaimedRewardsByTransactionId } from 'lbryinc'; import { doOpenModal } from 'redux/actions/app'; import { selectAllMyClaimsByOutpoint, - selectSupportsById, + selectSupportsByOutpoint, selectTransactionListFilter, doSetTransactionListFilter, } from 'lbry-redux'; @@ -11,7 +11,7 @@ import TransactionList from './view'; const select = state => ({ rewards: selectClaimedRewardsByTransactionId(state), - mySupports: selectSupportsById(state), + mySupports: selectSupportsByOutpoint(state), myClaims: selectAllMyClaimsByOutpoint(state), filterSetting: selectTransactionListFilter(state), }); diff --git a/src/ui/component/transactionList/view.jsx b/src/ui/component/transactionList/view.jsx index 14b3ae9ac..35ad1c861 100644 --- a/src/ui/component/transactionList/view.jsx +++ b/src/ui/component/transactionList/view.jsx @@ -43,8 +43,9 @@ class TransactionList extends React.PureComponent { } isRevokeable(txid: string, nout: number) { + const outpoint = `${txid}:${nout}`; const { mySupports, myClaims } = this.props; - return !!mySupports[txid] || myClaims.has(`${txid}:${nout}`); + return !!mySupports[outpoint] || myClaims.has(outpoint); } revokeClaim(txid: string, nout: number) { From 7bb34fc7b5ee3235d9be8ec75d560d02ee2e6207 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 01:12:24 -0400 Subject: [PATCH 36/49] maintain channel page number on tab change --- src/ui/page/channel/index.js | 2 ++ src/ui/page/channel/view.jsx | 10 +++++++--- yarn.lock | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ui/page/channel/index.js b/src/ui/page/channel/index.js index 0974411c7..a4715823e 100644 --- a/src/ui/page/channel/index.js +++ b/src/ui/page/channel/index.js @@ -4,6 +4,7 @@ import { makeSelectTitleForUri, makeSelectThumbnailForUri, makeSelectCoverForUri, + selectCurrentChannelPage, } from 'lbry-redux'; import ChannelPage from './view'; @@ -12,6 +13,7 @@ const select = (state, props) => ({ thumbnail: makeSelectThumbnailForUri(props.uri)(state), cover: makeSelectCoverForUri(props.uri)(state), channelIsMine: makeSelectClaimIsMine(props.uri)(state), + page: selectCurrentChannelPage(state), }); export default connect( diff --git a/src/ui/page/channel/view.jsx b/src/ui/page/channel/view.jsx index 43b2fa3d3..8cc4ca472 100644 --- a/src/ui/page/channel/view.jsx +++ b/src/ui/page/channel/view.jsx @@ -19,13 +19,14 @@ type Props = { title: ?string, cover: ?string, thumbnail: ?string, + page: number, location: { search: string }, history: { push: string => void }, match: { params: { attribute: ?string } }, }; function ChannelPage(props: Props) { - const { uri, title, cover, history, location } = props; + const { uri, title, cover, history, location, page } = props; const { channelName, claimName, claimId } = parseURI(uri); const { search } = location; const urlParams = new URLSearchParams(search); @@ -37,11 +38,14 @@ function ChannelPage(props: Props) { const tabIndex = currentView === ABOUT_PAGE ? 1 : 0; const onTabChange = newTabIndex => { let url = formatLbryUriForWeb(uri); + let search = '?'; if (newTabIndex !== 0) { - url += `?${PAGE_VIEW_QUERY}=${ABOUT_PAGE}`; + search += `${PAGE_VIEW_QUERY}=${ABOUT_PAGE}`; + } else { + search += `page=${page}`; } - history.push(url); + history.push(`${url}${search}`); }; return ( diff --git a/yarn.lock b/yarn.lock index 78a16a524..e5a0fd298 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6491,9 +6491,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#c8126ab21792d7a85e1123a2363af285a0263654: +lbry-redux@lbryio/lbry-redux#02f6918238110726c0b3b4248c61a84ac0b969e3: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/c8126ab21792d7a85e1123a2363af285a0263654" + resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/02f6918238110726c0b3b4248c61a84ac0b969e3" dependencies: proxy-polyfill "0.1.6" reselect "^3.0.0" From eba15030bb4faebbd88d16f686cbd1dd49ac3bc9 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 01:19:29 -0400 Subject: [PATCH 37/49] update sdk --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ccb87c14..eed69dbd9 100644 --- a/package.json +++ b/package.json @@ -187,7 +187,7 @@ "yarn": "^1.3" }, "lbrySettings": { - "lbrynetDaemonVersion": "0.37.0rc7", + "lbrynetDaemonVersion": "0.37.0", "lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip", "lbrynetDaemonDir": "static/daemon", "lbrynetDaemonFileName": "lbrynet" From 5840f8ef58373e398eb3443fc73d8f2fca2cd62b Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 01:22:51 -0400 Subject: [PATCH 38/49] v0.32.0-rc.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eed69dbd9..6559cca2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.32.0-rc.4", + "version": "0.32.0-rc.5", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "keywords": [ "lbry" From 5c41ac7a6d7402c473837b18c02edcfd2f5ce981 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 10:54:04 -0400 Subject: [PATCH 39/49] make share modal labels easier to read --- src/ui/component/socialShare/view.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/component/socialShare/view.jsx b/src/ui/component/socialShare/view.jsx index 669589ac7..fbbf014be 100644 --- a/src/ui/component/socialShare/view.jsx +++ b/src/ui/component/socialShare/view.jsx @@ -27,7 +27,7 @@ class SocialShare extends React.PureComponent { render() { const { claim, isChannel } = this.props; - const { claim_id: claimId, name: claimName, channel_name: channelName, value } = claim; + const { claim_id: claimId, name: claimName, channel_name: channelName } = claim; const { speechShareable, onDone } = this.props; const channelClaimId = claim.signing_channel && claim.signing_channel.claim_id; @@ -70,7 +70,7 @@ class SocialShare extends React.PureComponent { {speechShareable && (
- +
@@ -98,7 +98,7 @@ class SocialShare extends React.PureComponent {
)}
- +
From 304a399d3e6effd8147f94398c9e3a331978449a Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 11:44:51 -0400 Subject: [PATCH 40/49] v0.32.0-rc.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6559cca2b..051580488 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.32.0-rc.5", + "version": "0.32.0-rc.6", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "keywords": [ "lbry" From b7a40938cf5116d1cdd2b981ef33622e34f65b82 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 14:22:29 -0400 Subject: [PATCH 41/49] v0.32.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 051580488..4406a3cc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.32.0-rc.6", + "version": "0.32.0", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "keywords": [ "lbry" From 01bc69839c6b20ba4c3327f7382a445dbd37962b Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 15:24:59 -0400 Subject: [PATCH 42/49] enable desktop ga --- src/ui/analytics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/analytics.js b/src/ui/analytics.js index 9e5068c57..e4800b450 100644 --- a/src/ui/analytics.js +++ b/src/ui/analytics.js @@ -76,7 +76,7 @@ const analytics: Analytics = { // Initialize google analytics // Set `debug: true` for debug info // Will change once we have separate ids for desktop/web -const UA_ID = IS_WEB ? 'UA-60403362-12' : 'UA-60403362-12'; +const UA_ID = IS_WEB ? 'UA-60403362-12' : 'UA-60403362-13'; ReactGA.initialize(UA_ID, { gaOptions: { name: IS_WEB ? 'web' : 'desktop' }, From 3ae2c196567d6f3beaa7dc6f6e391541c44dc3b6 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 15:28:49 -0400 Subject: [PATCH 43/49] fix: text not wrapping on file page --- src/ui/scss/component/_media.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/scss/component/_media.scss b/src/ui/scss/component/_media.scss index 5f4139fc7..b4321fc29 100644 --- a/src/ui/scss/component/_media.scss +++ b/src/ui/scss/component/_media.scss @@ -260,6 +260,7 @@ .media__info-text { font-size: 1.15rem; + word-break: break-all; &:not(:last-of-type) { margin-bottom: var(--spacing-vertical-large); From e1cfe6c58f2ee6e3ac76f40aa39e5369f53dcee6 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 16:35:49 -0400 Subject: [PATCH 44/49] fix: analytics on desktop --- package.json | 1 + src/ui/analytics.js | 20 +++++++++++++++++--- yarn.lock | 29 ++++++++++++++++++++++++++--- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 4406a3cc4..53d62571b 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "@babel/preset-flow": "^7.0.0", "@babel/preset-react": "^7.0.0", "@babel/register": "^7.0.0", + "@exponent/electron-cookies": "^2.0.0", "@hot-loader/react-dom": "16.8", "@lbry/color": "^1.0.2", "@lbry/components": "^2.7.0", diff --git a/src/ui/analytics.js b/src/ui/analytics.js index e4800b450..2dffc0b6c 100644 --- a/src/ui/analytics.js +++ b/src/ui/analytics.js @@ -2,6 +2,9 @@ import { Lbryio } from 'lbryinc'; import ReactGA from 'react-ga'; import { history } from './store'; +// @if TARGET='app' +import ElectronCookies from '@exponent/electron-cookies'; +// @endif type Analytics = { pageView: string => void, @@ -15,7 +18,7 @@ let analyticsEnabled: boolean = true; const analytics: Analytics = { pageView: path => { if (analyticsEnabled) { - ReactGA.pageview(path, IS_WEB ? ['web'] : ['desktop']); + ReactGA.pageview(path); } }, setUser: user => { @@ -78,16 +81,27 @@ const analytics: Analytics = { // Will change once we have separate ids for desktop/web const UA_ID = IS_WEB ? 'UA-60403362-12' : 'UA-60403362-13'; +// @if TARGET='app' +ElectronCookies.enable({ + origin: 'https://lbry.tv', +}); +// @endif + ReactGA.initialize(UA_ID, { - gaOptions: { name: IS_WEB ? 'web' : 'desktop' }, testMode: process.env.NODE_ENV !== 'production', - // debug: true, + cookieDomain: 'auto', }); // Manually call the first page view // React Router doesn't include this on `history.listen` analytics.pageView(window.location.pathname + window.location.search); +// @if TARGET='app' +ReactGA.set({ checkProtocolTask: null }); +ReactGA.set({ location: 'https://lbry.tv' }); +analytics.pageView(window.location.pathname.split('.html')[1] + window.location.search || '/'); +// @endif; + // Listen for url changes and report // This will include search queries history.listen(location => { diff --git a/yarn.lock b/yarn.lock index e5a0fd298..06015dcc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -823,6 +823,14 @@ resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.1.tgz#e93c13942592cf5ef01aa8297444dc192beee52f" integrity sha512-Qv4LTqO11jepd5Qmlp3M1YEjBumoTHcHFdgPTQ+sFlIL5myi/7xu/POwP7IRu6odBdmLXdtIs1D6TuW6kbwbbg== +"@exponent/electron-cookies@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@exponent/electron-cookies/-/electron-cookies-2.0.0.tgz#4cf8dcf851454036cc524c40e9e482fc4e23f2d9" + integrity sha1-TPjc+FFFQDbMUkxA6eSC/E4j8tk= + dependencies: + tough-cookie "^2.2.2" + tough-cookie-web-storage-store "^1.0.0" + "@hot-loader/react-dom@16.8": version "16.8.6" resolved "https://registry.yarnpkg.com/@hot-loader/react-dom/-/react-dom-16.8.6.tgz#7923ba27db1563a7cc48d4e0b2879a140df461ea" @@ -6769,7 +6777,7 @@ lodash.unset@^4.5.2: resolved "https://registry.yarnpkg.com/lodash.unset/-/lodash.unset-4.5.2.tgz#370d1d3e85b72a7e1b0cdf2d272121306f23e4ed" integrity sha1-Nw0dPoW3Kn4bDN8tJyEhMG8j5O0= -lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@~4.17.10: +lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.6.1, lodash@~4.17.10: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== @@ -9062,7 +9070,7 @@ pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= -psl@^1.1.24: +psl@^1.1.24, psl@^1.1.28: version "1.1.31" resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== @@ -9122,7 +9130,7 @@ punycode@^1.2.4, punycode@^1.4.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -punycode@^2.1.0: +punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== @@ -11067,6 +11075,21 @@ toposort@^1.0.0: resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029" integrity sha1-LmhELZ9k7HILjMieZEOsbKqVACk= +tough-cookie-web-storage-store@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/tough-cookie-web-storage-store/-/tough-cookie-web-storage-store-1.0.0.tgz#8021fce24290bf0b6151e491d7312343451d390d" + integrity sha1-gCH84kKQvwthUeSR1zEjQ0UdOQ0= + dependencies: + lodash "^4.6.1" + +tough-cookie@^2.2.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" From 4b8f01b3179d6f69949435cc5d1a2e04fd1b03e3 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 16:36:05 -0400 Subject: [PATCH 45/49] v0.32.1-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 53d62571b..d4f198891 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.32.0", + "version": "0.32.1-rc.1", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "keywords": [ "lbry" From dfbe318f7a7fd542385d397b40c1270ca33f3f8f Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 14 May 2019 17:01:10 -0400 Subject: [PATCH 46/49] v0.32.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d4f198891..9995e0e7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.32.1-rc.1", + "version": "0.32.1", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "keywords": [ "lbry" From c7eff6883f7969701d8ca7827b0f396d3bed0e5b Mon Sep 17 00:00:00 2001 From: zxawry Date: Sun, 12 May 2019 15:46:14 +0100 Subject: [PATCH 47/49] show warning when opening external files and links --- src/ui/component/externalLink/view.jsx | 2 +- src/ui/component/fileDownloadLink/index.js | 4 +- src/ui/component/fileDownloadLink/view.jsx | 24 ++++++---- src/ui/constants/modal_types.js | 2 +- src/ui/modal/modalOpenExternalLink/index.js | 12 ----- src/ui/modal/modalOpenExternalLink/view.jsx | 52 --------------------- src/ui/modal/modalRouter/view.jsx | 6 +-- 7 files changed, 21 insertions(+), 81 deletions(-) delete mode 100644 src/ui/modal/modalOpenExternalLink/index.js delete mode 100644 src/ui/modal/modalOpenExternalLink/view.jsx diff --git a/src/ui/component/externalLink/view.jsx b/src/ui/component/externalLink/view.jsx index 95dd429b0..ccab6ad27 100644 --- a/src/ui/component/externalLink/view.jsx +++ b/src/ui/component/externalLink/view.jsx @@ -37,7 +37,7 @@ class ExternalLink extends React.PureComponent { title={title || href} label={children} className="button--external-link" - onClick={() => openModal(MODALS.CONFIRM_EXTERNAL_LINK, { uri: href })} + onClick={() => openModal(MODALS.CONFIRM_EXTERNAL_RESOURCE, { uri: href })} /> ); } diff --git a/src/ui/component/fileDownloadLink/index.js b/src/ui/component/fileDownloadLink/index.js index 50519c69b..b511885bc 100644 --- a/src/ui/component/fileDownloadLink/index.js +++ b/src/ui/component/fileDownloadLink/index.js @@ -6,7 +6,7 @@ import { makeSelectClaimForUri, } from 'lbry-redux'; import { makeSelectCostInfoForUri } from 'lbryinc'; -import { doOpenFileInShell } from 'redux/actions/file'; +import { doOpenModal } from 'redux/actions/app'; import { doPurchaseUri, doStartDownload, doSetPlayingUri } from 'redux/actions/content'; import FileDownloadLink from './view'; @@ -20,7 +20,7 @@ const select = (state, props) => ({ }); const perform = dispatch => ({ - openInShell: path => dispatch(doOpenFileInShell(path)), + openModal: (modal, props) => dispatch(doOpenModal(modal, props)), purchaseUri: uri => dispatch(doPurchaseUri(uri)), restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint)), pause: () => dispatch(doSetPlayingUri(null)), diff --git a/src/ui/component/fileDownloadLink/view.jsx b/src/ui/component/fileDownloadLink/view.jsx index 9ac82ba80..0d3178390 100644 --- a/src/ui/component/fileDownloadLink/view.jsx +++ b/src/ui/component/fileDownloadLink/view.jsx @@ -1,5 +1,6 @@ // @flow import * as ICONS from 'constants/icons'; +import * as MODALS from 'constants/modal_types'; import React from 'react'; import Button from 'component/button'; import ToolTip from 'component/common/tooltip'; @@ -20,7 +21,7 @@ type Props = { loading: boolean, costInfo: ?{}, restartDownload: (string, number) => void, - openInShell: string => void, + openModal: (id: string, { path: string }) => void, purchaseUri: string => void, pause: () => void, }; @@ -43,14 +44,7 @@ class FileDownloadLink extends React.PureComponent { uri: ?string; render() { - const { fileInfo, downloading, uri, openInShell, purchaseUri, costInfo, loading, pause, claim } = this.props; - - const openFile = () => { - if (fileInfo) { - openInShell(fileInfo.download_path); - pause(); - } - }; + const { fileInfo, downloading, uri, openModal, purchaseUri, costInfo, loading, pause, claim } = this.props; if (loading || downloading) { const progress = fileInfo && fileInfo.written_bytes ? (fileInfo.written_bytes / fileInfo.total_bytes) * 100 : 0; @@ -83,7 +77,17 @@ class FileDownloadLink extends React.PureComponent { } else if (fileInfo && fileInfo.download_path) { return ( -