UX: Improve usability of purchase page (#54)
Commit does 3 things: Remove the duplicative currency abbreviation in favor of the currency symbol alone Reorders plans by the cost in ascending order. Fixes a flexbox button bug
This commit is contained in:
parent
0126b12761
commit
7f84cee940
|
@ -1,6 +1,14 @@
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
|
@discourseComputed("plans")
|
||||||
|
orderedPlans(plans) {
|
||||||
|
if (plans) {
|
||||||
|
return plans.sort((a, b) => (a.unit_amount > b.unit_amount ? 1 : -1));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
if (this.plans && this.plans.length === 1) {
|
if (this.plans && this.plans.length === 1) {
|
||||||
|
|
|
@ -24,5 +24,5 @@ export default Helper.helper(function (params) {
|
||||||
currencySign = "$";
|
currencySign = "$";
|
||||||
}
|
}
|
||||||
|
|
||||||
return currencySign + params.map((p) => p.toUpperCase()).join(" ");
|
return currencySign + params[1];
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="subscribe-buttons">
|
<div class="subscribe-buttons">
|
||||||
{{#each plans as |plan|}}
|
{{#each orderedPlans as |plan|}}
|
||||||
{{payment-plan plan=plan selectedPlan=selectedPlan clickPlan=(action "clickPlan")}}
|
{{payment-plan plan=plan selectedPlan=selectedPlan clickPlan=(action "clickPlan")}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
|
||||||
.btn-discourse-subscriptions-subscribe {
|
.btn-discourse-subscriptions-subscribe {
|
||||||
|
flex-direction: column;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
div {
|
div {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
|
|
@ -36,7 +36,7 @@ componentTest("Payment plan subscription button rendered", {
|
||||||
find(".btn-discourse-subscriptions-subscribe:first-child .amount")
|
find(".btn-discourse-subscriptions-subscribe:first-child .amount")
|
||||||
.text()
|
.text()
|
||||||
.trim(),
|
.trim(),
|
||||||
"$AUD 44.99",
|
"$44.99",
|
||||||
"The plan amount and currency is shown"
|
"The plan amount and currency is shown"
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue