add builder currencies prop

pull/217/head
Pete Matsyburka 2 years ago
parent 5c69b965c0
commit b4ba642f8e

@ -89,6 +89,7 @@ window.customElements.define('template-builder', class extends HTMLElement {
withPhone: this.dataset.withPhone === 'true',
withLogo: this.dataset.withLogo !== 'false',
withPayment: this.dataset.withPayment === 'true',
currencies: (this.dataset.currencies || '').split(',').filter(Boolean),
acceptFileTypes: this.dataset.acceptFileTypes,
isDirectUpload: this.dataset.isDirectUpload === 'true'
})

@ -304,6 +304,7 @@ export default {
template: this.template,
save: this.save,
t: this.t,
currencies: this.currencies,
baseFetch: this.baseFetch,
fieldTypes: this.fieldTypes,
backgroundColor: this.backgroundColor,
@ -352,6 +353,11 @@ export default {
required: false,
default: () => []
},
currencies: {
type: Array,
required: false,
default: () => []
},
fieldTypes: {
type: Array,
required: false,

@ -31,7 +31,7 @@
@change="save"
>
<option
v-for="currency in currencies"
v-for="currency in currenciesList"
:key="currency"
:value="currency"
>
@ -167,7 +167,7 @@ export default {
IconInnerShadowTop,
IconBrandStripe
},
inject: ['backgroundColor', 'save'],
inject: ['backgroundColor', 'save', 'currencies'],
props: {
field: {
type: Object,
@ -187,9 +187,12 @@ export default {
redirectUri () {
return document.location.origin + '/auth/stripe_connect/callback'
},
currencies () {
defaultCurrencies () {
return ['USD', 'EUR', 'GBP']
},
currenciesList () {
return this.currencies.length ? this.currencies : this.defaultCurrencies
},
authenticityToken () {
return document.querySelector('meta[name="csrf-token"]')?.content
},

Loading…
Cancel
Save