From 516a3f52e823b76096b18987d66cf4b0eb396b5d Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 24 Sep 2018 20:17:08 -0400 Subject: [PATCH] improve bid/name help text --- .../publishForm/internal/bid-help-text.jsx | 70 +++++-------------- .../publishForm/internal/name-help-text.jsx | 49 +++++++++++++ src/renderer/component/publishForm/view.jsx | 56 +++++++++------ src/renderer/page/file/view.jsx | 1 + src/renderer/page/publish/index.js | 53 ++++---------- src/renderer/redux/reducers/navigation.js | 2 +- src/renderer/redux/selectors/publish.js | 54 +++++++++++++- src/renderer/scss/component/_form-field.scss | 2 +- 8 files changed, 170 insertions(+), 117 deletions(-) create mode 100644 src/renderer/component/publishForm/internal/name-help-text.jsx diff --git a/src/renderer/component/publishForm/internal/bid-help-text.jsx b/src/renderer/component/publishForm/internal/bid-help-text.jsx index 9230b8e73..7dff7d425 100644 --- a/src/renderer/component/publishForm/internal/bid-help-text.jsx +++ b/src/renderer/component/publishForm/internal/bid-help-text.jsx @@ -1,72 +1,34 @@ // @flow import * as React from 'react'; -import Button from 'component/button'; -import { buildURI } from 'lbry-redux'; -import type { Claim } from 'types/claim'; type Props = { uri: ?string, isResolvingUri: boolean, - winningBidForClaimUri: ?number, - myClaimForUri: ?Claim, - isStillEditing: boolean, - onEditMyClaim: (any, string) => void, + amountNeededForTakeover: ?number, }; class BidHelpText extends React.PureComponent { render() { - const { - uri, - isResolvingUri, - winningBidForClaimUri, - myClaimForUri, - onEditMyClaim, - isStillEditing, - } = this.props; + const { uri, isResolvingUri, amountNeededForTakeover } = this.props; + let bidHelpText; - if (!uri) { - return __('Create a URL for this content.'); + if (uri) { + if (isResolvingUri) { + bidHelpText = __('Checking the winning claim amount...'); + } else if (!amountNeededForTakeover) { + bidHelpText = __('Any amount will give you the winning bid.'); + } else { + bidHelpText = `${__('If you bid more than')} ${amountNeededForTakeover} LBC, ${__( + 'when somone navigates to' + )} ${uri} ${__('it will load your published content')}.`; + } } - if (isStillEditing) { - return __( - 'You are currently editing this claim. If you change the URL, you will need to reselect a file.' - ); - } - - if (isResolvingUri) { - return __('Checking the winning claim amount...'); - } - - if (myClaimForUri) { - const editUri = buildURI({ - contentName: myClaimForUri.name, - claimId: myClaimForUri.claim_id, - }); - - return ( - - {__('You already have a claim at')} - {` ${uri} `} -