DEV: Refactor payment plan buttons (#131)
This commit is contained in:
parent
a78b92ddcc
commit
39b7253c08
|
@ -1,12 +0,0 @@
|
||||||
import Button from "discourse/components/d-button";
|
|
||||||
|
|
||||||
export default Button.extend({
|
|
||||||
seleted: false,
|
|
||||||
|
|
||||||
init() {
|
|
||||||
this._super(...arguments);
|
|
||||||
this.classNameBindings = this.classNameBindings.concat(
|
|
||||||
"selected:btn-primary"
|
|
||||||
);
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -5,8 +5,8 @@ const RECURRING = "recurring";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
@discourseComputed("selectedPlan")
|
@discourseComputed("selectedPlan")
|
||||||
selected(planId) {
|
selectedClass(planId) {
|
||||||
return planId === this.plan.id;
|
return planId === this.plan.id ? "btn-primary" : "";
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed("plan.type")
|
@discourseComputed("plan.type")
|
||||||
|
|
|
@ -1,14 +1,11 @@
|
||||||
{{#ds-button
|
<DButton
|
||||||
action=(action "planClick")
|
@action={{action "planClick"}} @class={{concat "btn-discourse-subscriptions-subscribe " selectedClass}}>
|
||||||
selected=selected
|
|
||||||
class="btn-discourse-subscriptions-subscribe"
|
|
||||||
}}
|
|
||||||
<div class="interval">
|
<div class="interval">
|
||||||
{{#if recurringPlan}}
|
{{#if this.recurringPlan}}
|
||||||
{{i18n
|
{{i18n
|
||||||
(concat
|
(concat
|
||||||
"discourse_subscriptions.plans.interval.adverb."
|
"discourse_subscriptions.plans.interval.adverb."
|
||||||
plan.recurring.interval
|
this.plan.recurring.interval
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -17,6 +14,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="amount">
|
<span class="amount">
|
||||||
{{format-currency plan.currency plan.amountDollars}}
|
{{format-currency this.plan.currency this.plan.amountDollars}}
|
||||||
</span>
|
</span>
|
||||||
{{/ds-button}}
|
</DButton>
|
||||||
|
|
Loading…
Reference in New Issue