From f424e2e439d767be8daa0ec0894c366c0c32b7c2 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Mon, 26 Dec 2016 00:59:15 -0500 Subject: [PATCH] Show Download link only if file is not published by user --- js/component/file-tile.js | 6 ++-- js/page/my_files.js | 73 ++------------------------------------- 2 files changed, 6 insertions(+), 73 deletions(-) diff --git a/js/component/file-tile.js b/js/component/file-tile.js index 8feddfbce..f86c7ac93 100644 --- a/js/component/file-tile.js +++ b/js/component/file-tile.js @@ -75,8 +75,10 @@ let FileTile = React.createClass({
{this.props.mediaType == 'video' ? : null} - -
+ {!this.props.isMine + ? + : null} +

{this.props.description} diff --git a/js/page/my_files.js b/js/page/my_files.js index 2d6b28e66..f2381555b 100644 --- a/js/page/my_files.js +++ b/js/page/my_files.js @@ -3,6 +3,7 @@ import lbry from '../lbry.js'; import {Link, WatchLink} from '../component/link.js'; import {Menu, MenuItem} from '../component/menu.js'; import FormField from '../component/form.js'; +import FileTile from '../component/file-tile.js'; import Modal from '../component/modal.js'; import {BusyMessage, Thumbnail} from '../component/common.js'; @@ -93,77 +94,7 @@ var moreButtonColumnStyle = { marginLeft: 'auto', marginRight: 'auto', }; -var MyFilesRow = React.createClass({ - onPauseResumeClicked: function() { - if (this.props.stopped) { - lbry.startFile(this.props.lbryUri); - } else { - lbry.stopFile(this.props.lbryUri); - } - }, - render: function() { - //@TODO: Convert progress bar to reusable component - var progressBarWidth = 230; - - if (this.props.completed) { - var pauseLink = null; - var curProgressBarStyle = {display: 'none'}; - } else { - var pauseLink = { this.onPauseResumeClicked() }} />; - - var curProgressBarStyle = Object.assign({}, progressBarStyle); - curProgressBarStyle.width = Math.floor(this.props.ratioLoaded * progressBarWidth) + 'px'; - curProgressBarStyle.borderRightWidth = progressBarWidth - Math.ceil(this.props.ratioLoaded * progressBarWidth) + 2; - } - - if (this.props.showWatchButton) { - var watchButton = - } else { - var watchButton = null; - } - - return ( -

-
-
- -
-
-

{this.props.pending ? this.props.title : {this.props.title}}

- {this.props.pending ? This file is pending confirmation - : ( -
-
- { ' ' } - {this.props.completed - ? (this.props.isMine - ? 'Published' - : 'Download complete') - : (parseInt(this.props.ratioLoaded * 100) + '%')} -
{ pauseLink }
-
{ watchButton }
-
- ) - } -
-
- {this.props.pending ? null : -
- - -
- } -
-
-
- ); - } -}); var MyFilesPage = React.createClass({ _fileTimeout: null, @@ -354,7 +285,7 @@ var MyFilesPage = React.createClass({ var mediaType = lbry.getMediaType(metadata.content_type, file_name); var showWatchButton = (mediaType == 'video'); - content.push();