Skip to content

Commit

Permalink
added nearly complete currencies
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Dec 24, 2024
1 parent 9837c2c commit de5d53b
Show file tree
Hide file tree
Showing 3 changed files with 557 additions and 13 deletions.
8 changes: 6 additions & 2 deletions addon/components/currency-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export default class CurrencySelectComponent extends Component {

let whois = this.currentUser.getOption('whois');

this.currency = this.args.currency ?? whois?.currency?.code ?? 'USD';
this.currency = this.args.currency ?? this.args.value ?? whois?.currency?.code ?? 'USD';
this.currencyData = this.args.currencyData ?? getCurrency(this.currency);
}

@action onChange(currency) {
const { onChange, onCurrencyChange } = this.args;
const { onChange, onCurrencyChange, onSelect } = this.args;

this.currency = currency.code;
this.currencyData = currency;
Expand All @@ -29,6 +29,10 @@ export default class CurrencySelectComponent extends Component {
onCurrencyChange(currency.code, currency);
}

if (typeof onSelect === 'function') {
onSelect(currency.code, currency);
}

if (typeof onChange === 'function') {
onChange(currency);
}
Expand Down
2 changes: 1 addition & 1 deletion addon/components/modals/create-or-join-org.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<PhoneInput @value={{@options.phone}} @onInput={{fn (mut @options.phone)}} class="form-input w-full" />
</InputGroup>
<InputGroup @name="Organization currency">
<CurrencySelect @value={{@options.currency}} @onSelect={{fn (mut @options.currency)}} @triggerClass="w-full form-select" />
<CurrencySelect @currency={{@options.currency}} @onCurrencyChange={{fn (mut @options.currency)}} @triggerClass="w-full form-select" />
</InputGroup>
{{/if}}
</div>
Expand Down
Loading

0 comments on commit de5d53b

Please sign in to comment.