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({
|
||||
@discourseComputed("selectedPlan")
|
||||
selected(planId) {
|
||||
return planId === this.plan.id;
|
||||
selectedClass(planId) {
|
||||
return planId === this.plan.id ? "btn-primary" : "";
|
||||
},
|
||||
|
||||
@discourseComputed("plan.type")
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
{{#ds-button
|
||||
action=(action "planClick")
|
||||
selected=selected
|
||||
class="btn-discourse-subscriptions-subscribe"
|
||||
}}
|
||||
<DButton
|
||||
@action={{action "planClick"}} @class={{concat "btn-discourse-subscriptions-subscribe " selectedClass}}>
|
||||
<div class="interval">
|
||||
{{#if recurringPlan}}
|
||||
{{#if this.recurringPlan}}
|
||||
{{i18n
|
||||
(concat
|
||||
"discourse_subscriptions.plans.interval.adverb."
|
||||
plan.recurring.interval
|
||||
this.plan.recurring.interval
|
||||
)
|
||||
}}
|
||||
{{else}}
|
||||
|
@ -17,6 +14,6 @@
|
|||
</div>
|
||||
|
||||
<span class="amount">
|
||||
{{format-currency plan.currency plan.amountDollars}}
|
||||
{{format-currency this.plan.currency this.plan.amountDollars}}
|
||||
</span>
|
||||
{{/ds-button}}
|
||||
</DButton>
|
||||
|
|
Loading…
Reference in New Issue