refactor: use es6 import keyword

This commit is contained in:
José Oliveira 2021-07-06 18:49:31 +01:00
parent 2ff160cc68
commit bcbae6f19a

View file

@ -1,5 +1,6 @@
import { useQuery, useMutation } from '@apollo/react-hooks' import { useQuery, useMutation } from '@apollo/react-hooks'
import gql from 'graphql-tag' import gql from 'graphql-tag'
import { utils as coinUtils } from 'lamassu-coins'
import * as R from 'ramda' import * as R from 'ramda'
import React from 'react' import React from 'react'
@ -8,8 +9,6 @@ import { fromNamespace, toNamespace, namespaces } from 'src/utils/config'
import { AdvancedWalletSchema, getAdvancedWalletElements } from './helper' import { AdvancedWalletSchema, getAdvancedWalletElements } from './helper'
const { utils: coinUtils } = require('lamassu-coins')
const SAVE_CONFIG = gql` const SAVE_CONFIG = gql`
mutation Save($config: JSONObject, $accounts: JSONObject) { mutation Save($config: JSONObject, $accounts: JSONObject) {
saveConfig(config: $config) saveConfig(config: $config)
@ -44,19 +43,17 @@ const AdvancedWallet = () => {
const cryptoCurrencies = data?.cryptoCurrencies ?? [] const cryptoCurrencies = data?.cryptoCurrencies ?? []
return ( return (
<> <EditableTable
<EditableTable name="advancedWallet"
name="advancedWallet" namespaces={R.map(R.path(['code']))(cryptoCurrencies)}
namespaces={R.map(R.path(['code']))(cryptoCurrencies)} data={config}
data={config} error={error?.message}
error={error?.message} enableEdit
enableEdit editWidth={174}
editWidth={174} save={save}
save={save} validationSchema={AdvancedWalletSchema}
validationSchema={AdvancedWalletSchema} elements={getAdvancedWalletElements(cryptoCurrencies, coinUtils)}
elements={getAdvancedWalletElements(cryptoCurrencies, coinUtils)} />
/>
</>
) )
} }