From c6732d3d3f75a6c1190942952465dcbd4549f192 Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Fri, 30 Mar 2018 12:13:11 -0400 Subject: [PATCH 1/2] add buttons to share spee.ch URLs on file and channel pages --- CHANGELOG.md | 3 --- .../common/form-components/form-row.jsx | 2 -- .../component/viewOnWebButton/index.js | 3 +++ .../component/viewOnWebButton/view.jsx | 21 ++++++++++++++++++ src/renderer/constants/icons.js | 1 + src/renderer/page/channel/view.jsx | 15 +++++++++++-- src/renderer/page/file/view.jsx | 22 ++++++++++++++----- src/renderer/scss/component/_form-field.scss | 4 ++++ 8 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 src/renderer/component/viewOnWebButton/index.js create mode 100644 src/renderer/component/viewOnWebButton/view.jsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f0e50e0f..981bf6cea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,7 +57,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). * App category for Linux ([#877](https://github.com/lbryio/lbry-app/pull/877)) * Add YouTube Sync reward ([#1147](https://github.com/lbryio/lbry-app/pull/1147)) * Retain previous screen sizing on startup ([#338](https://github.com/lbryio/lbry-app/issues/338)) - * Add 'Go to page' input on channel pagination ([#1166](https://github.com/lbryio/lbry-app/pull/1166)) ### Changed @@ -372,7 +371,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). * Removed placeholder values from price selection form fields, which was causing confusion that these were real values (#426) * Fixed showing "other currency" help tip in publish form, which was caused due to not "setting" state for price * Publish page now properly checks for all required fields are filled - * Fixed pagination styling for pages > 5 (#416) * Fixed sizing on squat videos (#419) * Support claims no longer show up on Published page (#384) * Fixed rendering of small prices (#461) @@ -410,7 +408,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Added * Replaced horizontal scrollbars with scroll arrows * Featured weekly reward content shows with an orange star - * Added pagination to channel pages ### Fixed diff --git a/src/renderer/component/common/form-components/form-row.jsx b/src/renderer/component/common/form-components/form-row.jsx index b18bcf795..f694c305e 100644 --- a/src/renderer/component/common/form-components/form-row.jsx +++ b/src/renderer/component/common/form-components/form-row.jsx @@ -4,7 +4,6 @@ import * as React from 'react'; import classnames from 'classnames'; type Props = { - centered?: boolean, children: React.Node, padded?: boolean, verticallyCentered?: boolean, @@ -22,7 +21,6 @@ export class FormRow extends React.PureComponent { return (
{ + const { uri } = props; + + return uri ? ( +
{contentList}
diff --git a/src/renderer/page/file/view.jsx b/src/renderer/page/file/view.jsx index 4071e9125..e8392ff6c 100644 --- a/src/renderer/page/file/view.jsx +++ b/src/renderer/page/file/view.jsx @@ -13,6 +13,7 @@ import DateTime from 'component/dateTime'; import * as icons from 'constants/icons'; import Button from 'component/button'; import SubscribeButton from 'component/subscribeButton'; +import ViewOnWebButton from 'component/viewOnWebButton'; import Page from 'component/page'; import player from 'render-media'; import * as settings from 'constants/settings'; @@ -80,12 +81,7 @@ class FilePage extends React.Component { } checkSubscription = (props: Props) => { - if ( - props.claim.value.publisherSignature && - props.subscriptions - .map(subscription => subscription.channelName) - .indexOf(props.claim.channel_name) !== -1 - ) { + if (props.subscriptions.find(sub => sub.channelName === props.claim.channel_name)) { props.checkSubscription({ channelName: props.claim.channel_name, uri: buildURI( @@ -114,6 +110,7 @@ class FilePage extends React.Component { prepareEdit, navigate, autoplay, + costInfo, } = this.props; // File info @@ -130,6 +127,11 @@ class FilePage extends React.Component { if (channelName && channelClaimId) { subscriptionUri = buildURI({ channelName, claimId: channelClaimId }, false); } + const speechSharable = + costInfo && + costInfo.cost === 0 && + contentType && + ['video', 'image'].includes(contentType.split('/')[0]); // We want to use the short form uri for editing // This is what the user is used to seeing, they don't care about the claim id @@ -191,6 +193,14 @@ class FilePage extends React.Component { )} + {speechSharable && ( + + )} diff --git a/src/renderer/scss/component/_form-field.scss b/src/renderer/scss/component/_form-field.scss index 8b814dbf0..9dd03b5d7 100644 --- a/src/renderer/scss/component/_form-field.scss +++ b/src/renderer/scss/component/_form-field.scss @@ -62,6 +62,10 @@ width: 35px; } + input.paginate-channel { + width: 35px; + } + &.form-field--auto-height { height: auto; } -- 2.45.2 From 6ba6ed5ffbe06a29a304579839e980ba1d423c0a Mon Sep 17 00:00:00 2001 From: seanyesmunt Date: Tue, 29 May 2018 22:41:59 -0400 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 981bf6cea..ff500fb76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). * Pre-fill publish URL after clicking "Put something here" link ([#1303](https://github.com/lbryio/lbry-app/pull/1303)) * Add Danger JS to automate code reviews ([#1289](https://github.com/lbryio/lbry-app/pull/1289)) * Autoplay downloaded and free media ([#584](https://github.com/lbryio/lbry-app/pull/1453)) + * Add 'Go to page' input on channel pagination ([#1166](https://github.com/lbryio/lbry-app/pull/1166)) + * Add "View on web" button on file/channel pages with spee.ch link ([#1222](https://github.com/lbryio/lbry-app/pull/1222)) ### Changed * Add flair to snackbar ([#1313](https://github.com/lbryio/lbry-app/pull/1313)) -- 2.45.2