feat: add RUB and BRL currencies, make settings currency dropdown dynamic
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { t, i18n } from '../../i18n.js'
|
||||
import { auth } from '../../services/auth.js'
|
||||
import { favoritesService } from '../../services/favorites.js'
|
||||
import { getCurrencySymbol, SUPPORTED_CURRENCIES } from '../../services/currency.js'
|
||||
|
||||
class PageSettings extends HTMLElement {
|
||||
constructor() {
|
||||
@@ -210,9 +211,11 @@ class PageSettings extends HTMLElement {
|
||||
<div class="setting-item">
|
||||
<label for="currency-select">${t('settings.currency')}</label>
|
||||
<select id="currency-select">
|
||||
<option value="USD" ${this.getCurrentCurrency() === 'USD' ? 'selected' : ''}>USD ($)</option>
|
||||
<option value="EUR" ${this.getCurrentCurrency() === 'EUR' ? 'selected' : ''}>EUR (€)</option>
|
||||
<option value="CHF" ${this.getCurrentCurrency() === 'CHF' ? 'selected' : ''}>CHF</option>
|
||||
${SUPPORTED_CURRENCIES.filter(c => c !== 'XMR').map(c => {
|
||||
const sym = getCurrencySymbol(c)
|
||||
const label = sym !== c ? `${c} (${sym})` : c
|
||||
return `<option value="${c}" ${this.getCurrentCurrency() === c ? 'selected' : ''}>${label}</option>`
|
||||
}).join('')}
|
||||
</select>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user