diff --git a/lib/new-admin/config/index.js b/lib/new-admin/config/index.js index d64a6246..832945e2 100644 --- a/lib/new-admin/config/index.js +++ b/lib/new-admin/config/index.js @@ -32,10 +32,12 @@ const mapLanguage = lang => { } const massageCryptos = cryptos => { + const betaList = ['LN'] const convert = crypto => ({ code: crypto['cryptoCode'], display: crypto['display'], - codeDisplay: crypto['cryptoCodeDisplay'] ?? crypto['cryptoCode'] + codeDisplay: crypto['cryptoCodeDisplay'] ?? crypto['cryptoCode'], + isBeta: betaList.includes(crypto.cryptoCode) }) return _.map(convert, cryptos) diff --git a/lib/new-admin/graphql/types/currency.type.js b/lib/new-admin/graphql/types/currency.type.js index a2d8afb4..adef4997 100644 --- a/lib/new-admin/graphql/types/currency.type.js +++ b/lib/new-admin/graphql/types/currency.type.js @@ -10,6 +10,7 @@ const typeDef = gql` code: String! display: String! codeDisplay: String! + isBeta: Boolean } type Query { diff --git a/new-lamassu-admin/src/pages/Locales/Locales.js b/new-lamassu-admin/src/pages/Locales/Locales.js index a91459e5..3a820c8a 100644 --- a/new-lamassu-admin/src/pages/Locales/Locales.js +++ b/new-lamassu-admin/src/pages/Locales/Locales.js @@ -47,6 +47,7 @@ const GET_DATA = gql` cryptoCurrencies { code display + isBeta } languages { code diff --git a/new-lamassu-admin/src/pages/Locales/helper.js b/new-lamassu-admin/src/pages/Locales/helper.js index 738fc75f..32b14e4e 100644 --- a/new-lamassu-admin/src/pages/Locales/helper.js +++ b/new-lamassu-admin/src/pages/Locales/helper.js @@ -16,7 +16,7 @@ const allFields = (getData, onChange, auxElements = []) => { if (!data) return '' return R.compose( - R.prop(code), + it => `${R.prop(code)(it)} ${it?.isBeta ? '(Beta)' : ''}`, R.find(R.propEq(compare ?? 'code', it)) )(data) } @@ -36,7 +36,12 @@ const allFields = (getData, onChange, auxElements = []) => { const countryData = getData(['countries']) const currencyData = getData(['currencies']) const languageData = getData(['languages']) - const cryptoData = getData(['cryptoCurrencies']) + const rawCryptoData = getData(['cryptoCurrencies']) + const cryptoData = rawCryptoData?.map(it => { + it.codeLabel = `${it.code}${it.isBeta ? ' (Beta)' : ''}` + return it + }) + const timezonesData = timezoneList const findSuggestion = it => { @@ -104,7 +109,7 @@ const allFields = (getData, onChange, auxElements = []) => { inputProps: { options: cryptoData, valueProp: 'code', - labelProp: 'code', + labelProp: 'codeLabel', multiple: true, optionsLimit: null, onChange diff --git a/new-lamassu-admin/src/pages/Wallet/Wallet.js b/new-lamassu-admin/src/pages/Wallet/Wallet.js index b0a9c0c8..11067cbc 100644 --- a/new-lamassu-admin/src/pages/Wallet/Wallet.js +++ b/new-lamassu-admin/src/pages/Wallet/Wallet.js @@ -45,6 +45,7 @@ const GET_INFO = gql` cryptoCurrencies { code display + isBeta } } ` diff --git a/new-lamassu-admin/src/pages/Wallet/helper.js b/new-lamassu-admin/src/pages/Wallet/helper.js index 14f303e9..cf2871bd 100644 --- a/new-lamassu-admin/src/pages/Wallet/helper.js +++ b/new-lamassu-admin/src/pages/Wallet/helper.js @@ -208,7 +208,7 @@ const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => { const widthAdjust = wizard ? 11 : 0 const viewCryptoCurrency = it => { const currencyDisplay = R.compose( - R.prop(['display']), + it => `${R.prop(['display'])(it)} ${it.isBeta ? '(Beta)' : ''}`, R.find(R.propEq('code', it)) )(cryptoCurrencies) return currencyDisplay