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 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)

View file

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

View file

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

View file

@ -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

View file

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

View file

@ -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