From 94b60beebc90c985292a23797075a115dfa4dffe Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Mon, 17 Apr 2017 05:18:41 -0400 Subject: [PATCH] Update download notice modal to include price --- ui/js/component/file-actions.js | 11 +++++++---- ui/js/page/watch.js | 9 +++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ui/js/component/file-actions.js b/ui/js/component/file-actions.js index 2f2a4074d..6c105ed75 100644 --- a/ui/js/component/file-actions.js +++ b/ui/js/component/file-actions.js @@ -1,7 +1,8 @@ import React from 'react'; import lbry from '../lbry.js'; +import uri from '../uri.js'; import {Link} from '../component/link.js'; -import {Icon} from '../component/common.js'; +import {Icon, FilePrice} from '../component/common.js'; import {Modal} from './modal.js'; import {FormField} from './form.js'; import {ToolTip} from '../component/tooltip.js'; @@ -155,6 +156,8 @@ let FileActionsRow = React.createClass({ linkBlock = ; } + const lbryUri = uri.normalizeLbryUri(this.props.uri); + const title = this.props.metadata ? this.props.metadata.title : lbryUri; return (
{this.state.fileInfo !== null || this.state.fileInfo.isMine @@ -167,7 +170,7 @@ let FileActionsRow = React.createClass({ : '' } - Do you want to purchase this? + Are you sure you'd like to buy {title} for credits? @@ -175,12 +178,12 @@ let FileActionsRow = React.createClass({ - LBRY was unable to download the stream lbry://{this.props.uri}. + LBRY was unable to download the stream {lbryUri}. -

Are you sure you'd like to remove {this.props.metadata ? this.props.metadata.title : this.props.uri} from LBRY?

+

Are you sure you'd like to remove {title} from LBRY?

diff --git a/ui/js/page/watch.js b/ui/js/page/watch.js index 315e19a9c..5332df5ff 100644 --- a/ui/js/page/watch.js +++ b/ui/js/page/watch.js @@ -1,5 +1,5 @@ import React from 'react'; -import {Icon, Thumbnail} from '../component/common.js'; +import {Icon, Thumbnail, FilePrice} from '../component/common.js'; import {Link} from '../component/link.js'; import lbry from '../lbry.js'; import Modal from '../component/modal.js'; @@ -13,8 +13,9 @@ const VideoStream = require('videostream'); export let WatchLink = React.createClass({ propTypes: { uri: React.PropTypes.string, + metadata: React.PropTypes.object, downloadStarted: React.PropTypes.bool, - onGet: React.PropTypes.func + onGet: React.PropTypes.func, }, getInitialState: function() { affirmedPurchase: false @@ -84,7 +85,7 @@ export let WatchLink = React.createClass({ - Do you want to purchase this? + Are you sure you'd like to buy {this.props.metadata.title} for credits?
); } @@ -200,7 +201,7 @@ export let Video = React.createClass({ this is the world's world loading screen and we shipped our software with it anyway...

{this.state.loadStatusMessage}
: :
- +
} );