From 21012483332f62e12bddd3624a4d7d74ed63ddb9 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Sat, 9 Jun 2018 18:33:19 -0700 Subject: [PATCH] fixed publish status updating --- client/build/components/Column/index.js | 5 -- client/build/components/Row/index.js | 5 -- client/build/containers/PublishStatus/view.js | 30 +++++--- client/scss/containers/_publish-status.scss | 3 + client/src/components/Column/index.jsx | 3 - client/src/components/Row/index.jsx | 3 - client/src/containers/PublishStatus/view.jsx | 69 +++++++++++++------ 7 files changed, 72 insertions(+), 46 deletions(-) diff --git a/client/build/components/Column/index.js b/client/build/components/Column/index.js index 6254cebf..93d11a6a 100644 --- a/client/build/components/Column/index.js +++ b/client/build/components/Column/index.js @@ -37,11 +37,6 @@ function (_React$Component) { } _createClass(Column, [{ - key: "shouldComponentUpdate", - value: function shouldComponentUpdate() { - return false; - } - }, { key: "render", value: function render() { return _react.default.createElement("div", { diff --git a/client/build/components/Row/index.js b/client/build/components/Row/index.js index 0fa3b026..83af000b 100644 --- a/client/build/components/Row/index.js +++ b/client/build/components/Row/index.js @@ -37,11 +37,6 @@ function (_React$Component) { } _createClass(Row, [{ - key: "shouldComponentUpdate", - value: function shouldComponentUpdate() { - return false; - } - }, { key: "render", value: function render() { return _react.default.createElement("div", { diff --git a/client/build/containers/PublishStatus/view.js b/client/build/containers/PublishStatus/view.js index 9aeb8543..cdec8d1d 100644 --- a/client/build/containers/PublishStatus/view.js +++ b/client/build/containers/PublishStatus/view.js @@ -13,6 +13,8 @@ var publishStates = _interopRequireWildcard(require("../../constants/publish_cla var _ButtonSecondary = _interopRequireDefault(require("@components/ButtonSecondary")); +var _Row = _interopRequireDefault(require("@components/Row")); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -53,30 +55,40 @@ function (_React$Component) { clearFile = _this$props.clearFile; return _react.default.createElement("div", { className: 'publish-status' - }, status === publishStates.LOAD_START && _react.default.createElement("div", null, _react.default.createElement("p", null, "File is loading to server"), _react.default.createElement("p", { + }, status === publishStates.LOAD_START && _react.default.createElement("div", { + className: 'status' + }, _react.default.createElement(_Row.default, null, _react.default.createElement("p", null, "le is loading to server")), _react.default.createElement(_Row.default, null, _react.default.createElement("p", { className: 'text--secondary' - }, "0%")), status === publishStates.LOADING && _react.default.createElement("div", null, _react.default.createElement("p", null, "File is loading to server"), _react.default.createElement("p", { + }, "0%"))), status === publishStates.LOADING && _react.default.createElement("div", { + className: 'status' + }, _react.default.createElement(_Row.default, null, _react.default.createElement("p", null, "File is loading to server")), _react.default.createElement(_Row.default, null, _react.default.createElement("p", { className: 'text--secondary' - }, message)), status === publishStates.PUBLISHING && _react.default.createElement("div", null, _react.default.createElement("p", null, "Upload complete. Your file is now being published on the blockchain..."), _react.default.createElement(_ProgressBar.default, { + }, message))), status === publishStates.PUBLISHING && _react.default.createElement("div", { + className: 'status' + }, _react.default.createElement(_Row.default, null, _react.default.createElement("p", null, "Upload complete. Your file is now being published on the blockchain...")), _react.default.createElement(_Row.default, null, _react.default.createElement(_ProgressBar.default, { size: 12 - }), _react.default.createElement("p", null, "Curious what magic is happening here? ", _react.default.createElement("a", { + })), _react.default.createElement(_Row.default, null, _react.default.createElement("p", null, "Curious what magic is happening here? ", _react.default.createElement("a", { className: "link--primary", target: "blank", href: "https://lbry.io/faq/what-is-lbry" - }, "Learn more."))), status === publishStates.SUCCESS && _react.default.createElement("div", null, _react.default.createElement("p", null, "Your publish is complete! You are being redirected to it now."), _react.default.createElement("p", null, "If you are not automatically redirected, ", _react.default.createElement("a", { + }, "Learn more.")))), status === publishStates.SUCCESS && _react.default.createElement("div", { + className: 'status' + }, _react.default.createElement(_Row.default, null, _react.default.createElement("p", null, "Your publish is complete! You are being redirected to it now.")), _react.default.createElement(_Row.default, null, _react.default.createElement("p", null, "If you are not automatically redirected, ", _react.default.createElement("a", { className: "link--primary", target: "_blank", href: message - }, "click here."))), status === publishStates.FAILED && _react.default.createElement("div", null, _react.default.createElement("p", null, "Something went wrong..."), _react.default.createElement("p", { + }, "click here.")))), status === publishStates.FAILED && _react.default.createElement("div", { + className: 'status' + }, _react.default.createElement(_Row.default, null, _react.default.createElement("p", null, "Something went wrong...")), _react.default.createElement(_Row.default, null, _react.default.createElement("p", { className: 'text--strong' - }, message), _react.default.createElement("p", null, "For help, post the above error text in the #speech channel on the ", _react.default.createElement("a", { + }, message)), _react.default.createElement(_Row.default, null, _react.default.createElement("p", null, "For help, post the above error text in the #speech channel on the ", _react.default.createElement("a", { className: "link--primary", href: "https://chat.lbry.io", target: "_blank" - }, "lbry discord")), _react.default.createElement(_ButtonSecondary.default, { + }, "lbry discord"))), _react.default.createElement(_Row.default, null, _react.default.createElement(_ButtonSecondary.default, { value: 'Reset', onClickHandler: clearFile - }))); + })))); } }]); diff --git a/client/scss/containers/_publish-status.scss b/client/scss/containers/_publish-status.scss index 2b64b3fc..fecc3bda 100644 --- a/client/scss/containers/_publish-status.scss +++ b/client/scss/containers/_publish-status.scss @@ -5,4 +5,7 @@ display: flex; flex-direction: column; justify-content: center; + .status { + text-align: center; + } } diff --git a/client/src/components/Column/index.jsx b/client/src/components/Column/index.jsx index 854464ec..dcd2e2bc 100644 --- a/client/src/components/Column/index.jsx +++ b/client/src/components/Column/index.jsx @@ -1,9 +1,6 @@ import React from 'react'; class Column extends React.Component { - shouldComponentUpdate () { - return false; - } render () { return (
diff --git a/client/src/components/Row/index.jsx b/client/src/components/Row/index.jsx index 01b8559a..82c0e806 100644 --- a/client/src/components/Row/index.jsx +++ b/client/src/components/Row/index.jsx @@ -1,9 +1,6 @@ import React from 'react'; class Row extends React.Component { - shouldComponentUpdate () { - return false; - } render () { return (
diff --git a/client/src/containers/PublishStatus/view.jsx b/client/src/containers/PublishStatus/view.jsx index d161f5d7..1b004e6a 100644 --- a/client/src/containers/PublishStatus/view.jsx +++ b/client/src/containers/PublishStatus/view.jsx @@ -2,6 +2,7 @@ import React from 'react'; import ProgressBar from '@components/ProgressBar'; import * as publishStates from '../../constants/publish_claim_states'; import ButtonSecondary from '@components/ButtonSecondary'; +import Row from '@components/Row'; class PublishStatus extends React.Component { render () { @@ -9,39 +10,65 @@ class PublishStatus extends React.Component { return (
{status === publishStates.LOAD_START && -
-

File is loading to server

-

0%

+
+ +

le is loading to server

+
+ +

0%

+
} {status === publishStates.LOADING && -
-

File is loading to server

-

{message}

+
+ +

File is loading to server

+
+ +

{message}

+
} {status === publishStates.PUBLISHING && -
-

Upload complete. Your file is now being published on the blockchain...

- -

Curious what magic is happening here? Learn more.

+
+ +

Upload complete. Your file is now being published on the blockchain...

+
+ + + + +

Curious what magic is happening here? Learn more.

+
} {status === publishStates.SUCCESS && -
-

Your publish is complete! You are being redirected to it now.

-

If you are not automatically redirected, click here.

+
+ +

Your publish is complete! You are being redirected to it now.

+
+ +

If you are not automatically redirected, click here.

+
} {status === publishStates.FAILED && -
-

Something went wrong...

-

{message}

-

For help, post the above error text in the #speech channel on the lbry discord

- +
+ +

Something went wrong...

+
+ +

{message}

+
+ +

For help, post the above error text in the #speech channel on the lbry discord

+
+ + +
}