Skip to content

Commit

Permalink
Purchases: Make Refund Window Clearer (#89249)
Browse files Browse the repository at this point in the history
* Update context-links.js

* Include refund information

* Update strings

* Address review

* Fix string

* Address review

* Address review

* Address review

* Remove support link

* Simply switch to "Refund available"

* Fix style

* Update style.scss
  • Loading branch information
Aurorum authored Dec 11, 2024
1 parent 9b18bc6 commit 87d9248
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions client/me/purchases/manage-purchase/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,23 @@ class ManagePurchase extends Component<
return null;
}

renderRefundText() {
const { purchase, translate } = this.props;

if ( ! purchase ) {
return null;
}

// Hide if refund window has lapsed.
if ( ! hasAmountAvailableToRefund( purchase ) || ! purchase?.mostRecentRenewDate ) {
return;
}

return (
<span className="manage-purchase__refund-text">{ translate( 'Refund available' ) }</span>
);
}

renderRemovePurchaseNavItem() {
const {
hasLoadedSites,
Expand Down Expand Up @@ -719,6 +736,7 @@ class ManagePurchase extends Component<
>
<MaterialIcon icon="delete" className="card__icon" />
{ text }
{ this.renderRefundText() }
</RemovePurchase>
);
}
Expand Down Expand Up @@ -923,6 +941,7 @@ class ManagePurchase extends Component<
<CompactCard href={ link } className="remove-purchase__card" onClick={ onClick }>
<MaterialIcon icon="delete" className="card__icon" />
{ getCancelPurchaseNavText( purchase, translate ) }
{ this.renderRefundText() }
</CompactCard>
);
}
Expand Down
6 changes: 6 additions & 0 deletions client/me/purchases/manage-purchase/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@
}
}

.manage-purchase__refund-text {
display: block;
font-size: $font-body-extra-small;
font-weight: 400;
}

.manage-purchase__settings-link {
display: block;
margin-top: 16px;
Expand Down

0 comments on commit 87d9248

Please sign in to comment.