chore: beta status on LN

This commit is contained in:
Rafael Taranto 2024-03-11 12:42:17 +00:00
parent 508adb573f
commit c06b373d5a
6 changed files with 15 additions and 5 deletions

View file

@ -32,10 +32,12 @@ const mapLanguage = lang => {
} }
const massageCryptos = cryptos => { const massageCryptos = cryptos => {
const betaList = ['LN']
const convert = crypto => ({ const convert = crypto => ({
code: crypto['cryptoCode'], code: crypto['cryptoCode'],
display: crypto['display'], display: crypto['display'],
codeDisplay: crypto['cryptoCodeDisplay'] ?? crypto['cryptoCode'] codeDisplay: crypto['cryptoCodeDisplay'] ?? crypto['cryptoCode'],
isBeta: betaList.includes(crypto.cryptoCode)
}) })
return _.map(convert, cryptos) return _.map(convert, cryptos)

View file

@ -10,6 +10,7 @@ const typeDef = gql`
code: String! code: String!
display: String! display: String!
codeDisplay: String! codeDisplay: String!
isBeta: Boolean
} }
type Query { type Query {

View file

@ -47,6 +47,7 @@ const GET_DATA = gql`
cryptoCurrencies { cryptoCurrencies {
code code
display display
isBeta
} }
languages { languages {
code code

View file

@ -16,7 +16,7 @@ const allFields = (getData, onChange, auxElements = []) => {
if (!data) return '' if (!data) return ''
return R.compose( return R.compose(
R.prop(code), it => `${R.prop(code)(it)} ${it?.isBeta ? '(Beta)' : ''}`,
R.find(R.propEq(compare ?? 'code', it)) R.find(R.propEq(compare ?? 'code', it))
)(data) )(data)
} }
@ -36,7 +36,12 @@ const allFields = (getData, onChange, auxElements = []) => {
const countryData = getData(['countries']) const countryData = getData(['countries'])
const currencyData = getData(['currencies']) const currencyData = getData(['currencies'])
const languageData = getData(['languages']) 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 timezonesData = timezoneList
const findSuggestion = it => { const findSuggestion = it => {
@ -104,7 +109,7 @@ const allFields = (getData, onChange, auxElements = []) => {
inputProps: { inputProps: {
options: cryptoData, options: cryptoData,
valueProp: 'code', valueProp: 'code',
labelProp: 'code', labelProp: 'codeLabel',
multiple: true, multiple: true,
optionsLimit: null, optionsLimit: null,
onChange onChange

View file

@ -45,6 +45,7 @@ const GET_INFO = gql`
cryptoCurrencies { cryptoCurrencies {
code code
display display
isBeta
} }
} }
` `

View file

@ -208,7 +208,7 @@ const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
const widthAdjust = wizard ? 11 : 0 const widthAdjust = wizard ? 11 : 0
const viewCryptoCurrency = it => { const viewCryptoCurrency = it => {
const currencyDisplay = R.compose( const currencyDisplay = R.compose(
R.prop(['display']), it => `${R.prop(['display'])(it)} ${it.isBeta ? '(Beta)' : ''}`,
R.find(R.propEq('code', it)) R.find(R.propEq('code', it))
)(cryptoCurrencies) )(cryptoCurrencies)
return currencyDisplay return currencyDisplay