From 01dc3661c8ac380ca114020cb776f743b4f215b7 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 25 Jul 2018 00:23:58 -0400 Subject: [PATCH] wire up autoplay --- src/renderer/component/filePrice/view.jsx | 7 ++++++- src/renderer/component/recommendedVideos/index.js | 5 +++++ src/renderer/component/recommendedVideos/view.jsx | 8 +++++--- src/renderer/modal/modalAffirmPurchase/view.jsx | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/renderer/component/filePrice/view.jsx b/src/renderer/component/filePrice/view.jsx index d2a6a9245..ebb0318f1 100644 --- a/src/renderer/component/filePrice/view.jsx +++ b/src/renderer/component/filePrice/view.jsx @@ -9,7 +9,10 @@ type Props = { uri: string, fetching: boolean, claim: ?{}, + // below props are just passed to filePage?: boolean, + inheritStyle?: boolean, + showLBC?: boolean, }; class FilePrice extends React.PureComponent { @@ -34,12 +37,14 @@ class FilePrice extends React.PureComponent { }; render() { - const { costInfo, showFullPrice, filePage } = this.props; + const { costInfo, showFullPrice, filePage, inheritStyle, showLBC } = this.props; return costInfo ? ( ({ claimsInChannel: makeSelectClaimsInChannelForCurrentPage(props.channelUri)(state), + autoplay: makeSelectClientSetting(settings.AUTOPLAY)(state), }); const perform = dispatch => ({ fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)), + setAutoplay: value => dispatch(doSetClientSetting(settings.AUTOPLAY, value)), }); export default connect( diff --git a/src/renderer/component/recommendedVideos/view.jsx b/src/renderer/component/recommendedVideos/view.jsx index a843d5ec5..9236f42f0 100644 --- a/src/renderer/component/recommendedVideos/view.jsx +++ b/src/renderer/component/recommendedVideos/view.jsx @@ -8,6 +8,8 @@ import type { Claim } from 'types/claim'; type Props = { channelUri: ?string, claimsInChannel: ?Array, + autoplay: boolean, + setAutoplay: boolean => void, fetchClaims: (string, number) => void, }; @@ -20,7 +22,7 @@ export default class RecommendedVideos extends React.PureComponent { } render() { - const { claimsInChannel } = this.props; + const { claimsInChannel, autoplay, setAutoplay } = this.props; return (
@@ -32,8 +34,8 @@ export default class RecommendedVideos extends React.PureComponent { name="autoplay" type="checkbox" prefix={__('Autoplay')} - checked={false} - onChange={() => {}} + checked={autoplay} + onChange={e => setAutoplay(e.target.checked)} /> diff --git a/src/renderer/modal/modalAffirmPurchase/view.jsx b/src/renderer/modal/modalAffirmPurchase/view.jsx index 93b727b7c..df3a9301f 100644 --- a/src/renderer/modal/modalAffirmPurchase/view.jsx +++ b/src/renderer/modal/modalAffirmPurchase/view.jsx @@ -31,7 +31,7 @@ class ModalAffirmPurchase extends React.PureComponent { > {__('This will purchase')} {title} {__('for')}{' '} - + {' '} {__('credits')}.