Skip to content

Commit

Permalink
auction: show open as pending only until it is (kyokan#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
rithvikvibhu committed Feb 6, 2022
1 parent 75d1520 commit 620d5e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
20 changes: 15 additions & 5 deletions app/pages/Auction/BidActionPanel/OpenBid.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const analytics = aClientStub(() => require('electron').ipcRenderer);
class OpenBid extends Component {
static propTypes = {
domain: PropTypes.object.isRequired,
isPending: PropTypes.bool.isRequired,
sendOpen: PropTypes.func.isRequired,
showError: PropTypes.func.isRequired,
showSuccess: PropTypes.func.isRequired,
Expand Down Expand Up @@ -81,23 +82,31 @@ class OpenBid extends Component {
}

renderBottom() {
const {domain, currentBlock} = this.props;
const {domain, currentBlock, isPending} = this.props;
const {t} = this.context;
const {start} = domain || {};
const {start, info} = domain || {};
const {openPeriodEnd} = info?.stats || {}
const startBlock = start.start;

if (isOpening(domain)) {
return (
<div className="domains__bid-now__action--placing-bid">
<div className="domains__bid-now__content domains__bid-now__opening-text">
{t('openingText')}
{isPending ?
t('openingText')
:
<>
{t('openingTextWaitForBidding')}
<Blocktime height={openPeriodEnd} format="ll" fromNow={true} />
</>
}
</div>
<div className="domains__bid-now__action">
<button
className="domains__bid-now__action__cta"
disabled
>
{t('startingAuction')}
{isPending ? t('startingAuction') : t('openingNow')}
</button>
</div>
</div>
Expand Down Expand Up @@ -137,9 +146,10 @@ class OpenBid extends Component {
}

export default connect(
(state) => ({
(state, {domain}) => ({
currentBlock: state.node.chain.height,
network: state.wallet.network,
isPending: domain.pendingOperation === 'OPEN',
}),
(dispatch, {name}) => ({
sendOpen: () => dispatch(nameActions.sendOpen(name)),
Expand Down
3 changes: 2 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,11 @@
"obTermsHeader": "Terms of Use",
"openBidText": "Start the auction process by making an open bid.",
"openFailureText": "Failed to open auction: %s",
"openSuccessText": "Successfully opened auction! Check back in a few minutes to start bidding.",
"openSuccessText": "Successfully opened auction! Start bidding once the bidding period starts.",
"opening": "Opening",
"openingNow": "Opening Now",
"openingText": "Your open auction request is pending and will be mined within the next block.",
"openingTextWaitForBidding": "The auction will open for bidding in",
"optional": "Optional",
"ownedTitle": "You are the owner of this domain!",
"owner": "Owner",
Expand Down

0 comments on commit 620d5e2

Please sign in to comment.