From c2b51127acae9f729df495a63ae02995e7784061 Mon Sep 17 00:00:00 2001 From: Franco Montenegro Date: Fri, 6 Aug 2021 18:01:04 -0300 Subject: [PATCH] Reuse BidHelpText for reposts --- ui/component/repostCreate/view.jsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ui/component/repostCreate/view.jsx b/ui/component/repostCreate/view.jsx index 616a79cd1..c4e47be1c 100644 --- a/ui/component/repostCreate/view.jsx +++ b/ui/component/repostCreate/view.jsx @@ -15,6 +15,7 @@ import ClaimPreview from 'component/claimPreview'; import { URL as SITE_URL, URL_LOCAL, URL_DEV } from 'config'; import HelpLink from 'component/common/help-link'; import WalletSpendableBalanceHelp from 'component/walletSpendableBalanceHelp'; +import BidHelpText from 'component/publishBid/bid-help-text'; import Spinner from 'component/spinner'; type Props = { @@ -77,7 +78,6 @@ function RepostCreate(props: Props) { const [repostBid, setRepostBid] = React.useState(0.01); const [repostBidError, setRepostBidError] = React.useState(undefined); - const [takeoverAmount, setTakeoverAmount] = React.useState(0); const [enteredRepostName, setEnteredRepostName] = React.useState(defaultName); const [available, setAvailable] = React.useState(true); const [enteredContent, setEnteredContentUri] = React.useState(undefined); @@ -189,10 +189,9 @@ function RepostCreate(props: Props) { : Number(passedRepostAmount) + 0.01; if (repostTakeoverAmount) { - setTakeoverAmount(Number(repostTakeoverAmount.toFixed(2))); setAutoRepostBid(repostTakeoverAmount); } - }, [setTakeoverAmount, enteredRepostAmount, passedRepostAmount]); + }, [enteredRepostAmount, passedRepostAmount]); // repost bid error React.useEffect(() => { @@ -381,9 +380,11 @@ function RepostCreate(props: Props) { error={repostBidError} helper={ <> - {__('Winning amount: %amount%', { - amount: Number(takeoverAmount).toFixed(2), - })} + }