diff --git a/oracle/.eslintignore b/.eslintignore similarity index 89% rename from oracle/.eslintignore rename to .eslintignore index d7d48d5f..2fbc422f 100644 --- a/oracle/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ node_modules submodules coverage +lib diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..1c485cb5 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,22 @@ +{ + "extends": [ + "plugin:prettier/recommended" + ], + "plugins": ["prettier"], + "rules": { + "prettier/prettier": "error", + "arrow-body-style": "off", + "func-names": "off", + "no-await-in-loop": "off", + "no-console": "off", + "no-else-return": "off", + "no-param-reassign": "off", + "no-plusplus": "off", + "no-restricted-syntax": "off", + "no-shadow": "off", + "no-use-before-define": ["error", { "functions": false }], + "import/no-dynamic-require": "off", + "prefer-template": "off", + "no-underscore-dangle": "off" + } +} diff --git a/monitor/.prettierrc b/.prettierrc similarity index 100% rename from monitor/.prettierrc rename to .prettierrc diff --git a/monitor/.eslintrc b/monitor/.eslintrc index 9cde6f18..52920bd4 100644 --- a/monitor/.eslintrc +++ b/monitor/.eslintrc @@ -1,21 +1,11 @@ { - "plugins": ["node", "prettier"], + "plugins": ["node"], "extends": [ "plugin:node/recommended", "airbnb-base", - "plugin:prettier/recommended" + "../.eslintrc" ], "rules": { - "prettier/prettier": "error", - "arrow-body-style": "off", - "no-await-in-loop": "off", - "no-console": "off", - "no-else-return": "off", - "no-plusplus": "off", - "no-restricted-syntax": "off", - "no-shadow": "off", - "prefer-template": "off", - "no-use-before-define": "off", - "no-underscore-dangle": "off" + "no-use-before-define": "off" } } diff --git a/monitor/package.json b/monitor/package.json index 3363dc31..0106895e 100644 --- a/monitor/package.json +++ b/monitor/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "start": "node index.js", - "lint": "eslint .", + "lint": "eslint . --ignore-path ../.eslintignore", "lint:fix": "eslint . --fix" }, "author": "", diff --git a/oracle-e2e/.eslintrc b/oracle-e2e/.eslintrc deleted file mode 100644 index 611b02b0..00000000 --- a/oracle-e2e/.eslintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../.eslintrc", - "globals": { - "describe": false, - "it": false - } -} diff --git a/oracle/.eslintrc b/oracle/.eslintrc index 5d337516..156abfd4 100644 --- a/oracle/.eslintrc +++ b/oracle/.eslintrc @@ -2,20 +2,8 @@ "extends": [ "plugin:node/recommended", "airbnb-base", - "plugin:prettier/recommended" + "../.eslintrc" ], "plugins": ["node"], - "rules": { - "arrow-body-style": "off", - "func-names": "off", - "no-await-in-loop": "off", - "no-console": "off", - "no-else-return": "off", - "no-param-reassign": "off", - "no-plusplus": "off", - "no-restricted-syntax": "off", - "no-shadow": "off", - "no-use-before-define": ["error", { "functions": false }], - "import/no-dynamic-require": "off" - } + "rules": {} } diff --git a/oracle/.prettierrc b/oracle/.prettierrc deleted file mode 100644 index 75a894a2..00000000 --- a/oracle/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "printWidth": 100 -} diff --git a/oracle/package.json b/oracle/package.json index 36b61cef..61eb4773 100644 --- a/oracle/package.json +++ b/oracle/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "lint": "eslint .", + "lint": "eslint . --ignore-path ../.eslintignore", "watcher:signature-request": "./scripts/start-worker.sh watcher signature-request-watcher", "watcher:collected-signatures": "./scripts/start-worker.sh watcher collected-signatures-watcher", "watcher:affirmation-request": "./scripts/start-worker.sh watcher affirmation-request-watcher", diff --git a/ui/.eslintignore b/ui/.eslintignore deleted file mode 100644 index eee78aa5..00000000 --- a/ui/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -submodules -coverage -e2e-script diff --git a/ui/.eslintrc b/ui/.eslintrc index 922ee415..da40bac6 100644 --- a/ui/.eslintrc +++ b/ui/.eslintrc @@ -1,5 +1,11 @@ { - "extends": "react-app", + "extends": [ + "react-app", + "../.eslintrc" + ], + "rules": { + "no-use-before-define": "off" + }, "parserOptions": { "ecmaFeatures": { "legacyDecorators": true diff --git a/ui/config-overrides.js b/ui/config-overrides.js index 4638da3d..845fa768 100644 --- a/ui/config-overrides.js +++ b/ui/config-overrides.js @@ -1,10 +1,3 @@ -const { - addDecoratorsLegacy, - disableEsLint, - override -} = require("customize-cra"); +const { addDecoratorsLegacy, disableEsLint, override } = require('customize-cra') -module.exports = override( - addDecoratorsLegacy(), - disableEsLint() - ); \ No newline at end of file +module.exports = override(addDecoratorsLegacy(), disableEsLint()) diff --git a/ui/package.json b/ui/package.json index ad9002e7..ba6a8d5e 100644 --- a/ui/package.json +++ b/ui/package.json @@ -32,7 +32,7 @@ "web3-utils": "1.0.0-beta.30" }, "scripts": { - "lint": "eslint .", + "lint": "eslint . --ignore-path ../.eslintignore", "select-css-theme": "node scripts/selectTheme.js", "build-css": "node-sass-chokidar src/assets/stylesheets -o src/assets/stylesheets --output-style=compressed -m application*.css", "watch-css": "nodemon -e scss -x \"npm run build-css\"", diff --git a/ui/scripts/selectTheme.js b/ui/scripts/selectTheme.js index 9420f465..2afb14e2 100644 --- a/ui/scripts/selectTheme.js +++ b/ui/scripts/selectTheme.js @@ -1,17 +1,17 @@ -const path = require('path'); +const path = require('path') require('dotenv').config({ - path: path.resolve(__dirname, '..', '.env') -}); -const fs = require('fs'); + path: path.resolve(__dirname, '..', '.env') +}) +const fs = require('fs') -const stylePath = path.resolve(__dirname, '..', 'src', 'assets', 'stylesheets'); -const destinationFilename = 'application.css'; -let filename; +const stylePath = path.resolve(__dirname, '..', 'src', 'assets', 'stylesheets') +const destinationFilename = 'application.css' +let filename if (process.env.APP_STYLES === 'classic') { - filename = 'application.classic.css' + filename = 'application.classic.css' } else { - filename = 'application.core.css' + filename = 'application.core.css' } -fs.copyFileSync(path.resolve(stylePath, filename), path.resolve(stylePath, destinationFilename)); \ No newline at end of file +fs.copyFileSync(path.resolve(stylePath, filename), path.resolve(stylePath, destinationFilename)) diff --git a/ui/src/App.js b/ui/src/App.js index 8d08f2e7..336fcc5e 100644 --- a/ui/src/App.js +++ b/ui/src/App.js @@ -1,7 +1,16 @@ -import React from 'react'; -import { Header, Bridge, RelayEvents, Footer, SweetAlert, Loading, StatusPage, StatisticsPage } from './components'; +import React from 'react' +import { + Header, + Bridge, + RelayEvents, + Footer, + SweetAlert, + Loading, + StatusPage, + StatisticsPage +} from './components' import { Route } from 'react-router-dom' -import './assets/stylesheets/application.css'; +import './assets/stylesheets/application.css' import { Disclaimer } from './components' import { ModalContainer } from './components' import { NoWallet } from './components' @@ -16,43 +25,40 @@ export class App extends React.Component { componentDidMount() { const disclaimerDisplayed = getItem(DISCLAIMER_KEY) - if(!disclaimerDisplayed) { + if (!disclaimerDisplayed) { this.setState({ showDisclaimer: true }) } } closeDisclaimer = () => { setItem(DISCLAIMER_KEY, true) - this.setState({showDisclaimer: false}) + this.setState({ showDisclaimer: false }) } toggleMobileMenu = () => { - this.setState(prevState => ({ showMobileMenu: !prevState.showMobileMenu})) + this.setState(prevState => ({ showMobileMenu: !prevState.showMobileMenu })) } render() { const { showDisclaimer, showMobileMenu } = this.state return (
- - - -
- }/> + + + ( +
+ )} + />
- {showMobileMenu &&
}/>} - - - - + {showMobileMenu &&
} />} + + + +
- - + + diff --git a/ui/src/components/Authority.js b/ui/src/components/Authority.js index 79f34a4e..952ee7e6 100644 --- a/ui/src/components/Authority.js +++ b/ui/src/components/Authority.js @@ -2,9 +2,9 @@ import React from 'react' export const Authority = ({ address, number, logoIndex }) => (
- {number} + {number}
- {address} + {address}
-); +) diff --git a/ui/src/components/Bridge.js b/ui/src/components/Bridge.js index 944795ad..c18ae51e 100644 --- a/ui/src/components/Bridge.js +++ b/ui/src/components/Bridge.js @@ -1,5 +1,5 @@ import BN from 'bignumber.js' -import React from 'react'; +import React from 'react' import { toHex } from 'web3-utils' import foreignLogoPurple from '../assets/images/logos/logo-poa-20-purple@2x.png' import homeLogoPurple from '../assets/images/logos/logo-poa-sokol-purple@2x.png' @@ -12,15 +12,15 @@ import { ModalContainer } from './ModalContainer' import { NetworkDetails } from './NetworkDetails' import { TransferAlert } from './TransferAlert' import { getFeeToApply, validFee } from '../stores/utils/rewardable' -import { inject, observer } from "mobx-react"; +import { inject, observer } from 'mobx-react' import { toDecimals } from '../stores/utils/decimals' -@inject("RootStore") +@inject('RootStore') @observer export class Bridge extends React.Component { state = { reverse: false, - amount:'', + amount: '', modalData: {}, confirmationData: {}, showModal: false, @@ -36,7 +36,7 @@ export class Bridge extends React.Component { componentDidMount() { const { web3Store } = this.props.RootStore web3Store.getWeb3Promise.then(() => { - if(!web3Store.metamaskNet.id || !web3Store.foreignNet.id) { + if (!web3Store.metamaskNet.id || !web3Store.foreignNet.id) { this.forceUpdate() } else { const reverse = web3Store.metamaskNet.id.toString() === web3Store.foreignNet.id.toString() @@ -61,28 +61,40 @@ export class Bridge extends React.Component { }) } - async _sendToHome(amount){ + async _sendToHome(amount) { const { web3Store, homeStore, alertStore, txStore, bridgeMode } = this.props.RootStore const isErcToErcMode = bridgeMode === BRIDGE_MODES.ERC_TO_ERC const { isLessThan, isGreaterThan } = this - if(web3Store.metamaskNet.id.toString() !== web3Store.homeNet.id.toString()){ - swal("Error", `Please switch wallet to ${web3Store.homeNet.name} network`, "error") + if (web3Store.metamaskNet.id.toString() !== web3Store.homeNet.id.toString()) { + swal('Error', `Please switch wallet to ${web3Store.homeNet.name} network`, 'error') return } - if(isLessThan(amount, homeStore.minPerTx)){ - alertStore.pushError(`The amount is less than current minimum per transaction amount.\nThe minimum per transaction amount is: ${homeStore.minPerTx} ${homeStore.symbol}`) + if (isLessThan(amount, homeStore.minPerTx)) { + alertStore.pushError( + `The amount is less than current minimum per transaction amount.\nThe minimum per transaction amount is: ${ + homeStore.minPerTx + } ${homeStore.symbol}` + ) return } - if(isGreaterThan(amount, homeStore.maxPerTx)){ - alertStore.pushError(`The amount is above current maximum per transaction limit.\nThe maximum per transaction limit is: ${homeStore.maxPerTx} ${homeStore.symbol}`) + if (isGreaterThan(amount, homeStore.maxPerTx)) { + alertStore.pushError( + `The amount is above current maximum per transaction limit.\nThe maximum per transaction limit is: ${ + homeStore.maxPerTx + } ${homeStore.symbol}` + ) return } - if(isGreaterThan(amount, homeStore.maxCurrentDeposit)){ - alertStore.pushError(`The amount is above current daily limit.\nThe max deposit today: ${homeStore.maxCurrentDeposit} ${homeStore.symbol}`) + if (isGreaterThan(amount, homeStore.maxCurrentDeposit)) { + alertStore.pushError( + `The amount is above current daily limit.\nThe max deposit today: ${ + homeStore.maxCurrentDeposit + } ${homeStore.symbol}` + ) return } - if(isGreaterThan(amount, homeStore.getDisplayedBalance())){ - alertStore.pushError("Insufficient balance") + if (isGreaterThan(amount, homeStore.getDisplayedBalance())) { + alertStore.pushError('Insufficient balance') } else { try { alertStore.setLoading(true) @@ -90,12 +102,12 @@ export class Bridge extends React.Component { return txStore.erc677transferAndCall({ to: homeStore.HOME_BRIDGE_ADDRESS, from: web3Store.defaultAccount.address, - value: toDecimals(amount,homeStore.tokenDecimals), + value: toDecimals(amount, homeStore.tokenDecimals), contract: homeStore.tokenContract, tokenAddress: homeStore.tokenAddress }) } else { - const value = toHex(toDecimals(amount,homeStore.tokenDecimals)) + const value = toHex(toDecimals(amount, homeStore.tokenDecimals)) return txStore.doSend({ to: homeStore.HOME_BRIDGE_ADDRESS, from: web3Store.defaultAccount.address, @@ -110,28 +122,42 @@ export class Bridge extends React.Component { } } - async _sendToForeign(amount){ + async _sendToForeign(amount) { const { web3Store, foreignStore, alertStore, txStore } = this.props.RootStore const isExternalErc20 = foreignStore.tokenType === ERC_TYPES.ERC20 const { isLessThan, isGreaterThan } = this - if(web3Store.metamaskNet.id.toString() !== web3Store.foreignNet.id.toString()){ - swal("Error", `Please switch wallet to ${web3Store.foreignNet.name} network`, "error") + if (web3Store.metamaskNet.id.toString() !== web3Store.foreignNet.id.toString()) { + swal('Error', `Please switch wallet to ${web3Store.foreignNet.name} network`, 'error') return } - if(!isExternalErc20 && isLessThan(amount, foreignStore.minPerTx)){ - alertStore.pushError(`The amount is less than minimum amount per transaction.\nThe min per transaction is: ${foreignStore.minPerTx} ${foreignStore.symbol}`) + if (!isExternalErc20 && isLessThan(amount, foreignStore.minPerTx)) { + alertStore.pushError( + `The amount is less than minimum amount per transaction.\nThe min per transaction is: ${ + foreignStore.minPerTx + } ${foreignStore.symbol}` + ) return } - if(!isExternalErc20 && isGreaterThan(amount, foreignStore.maxPerTx)){ - alertStore.pushError(`The amount is above maximum amount per transaction.\nThe max per transaction is: ${foreignStore.maxPerTx} ${foreignStore.symbol}`) + if (!isExternalErc20 && isGreaterThan(amount, foreignStore.maxPerTx)) { + alertStore.pushError( + `The amount is above maximum amount per transaction.\nThe max per transaction is: ${ + foreignStore.maxPerTx + } ${foreignStore.symbol}` + ) return } - if(!isExternalErc20 && isGreaterThan(amount, foreignStore.maxCurrentDeposit)){ - alertStore.pushError(`The amount is above current daily limit.\nThe max withdrawal today: ${foreignStore.maxCurrentDeposit} ${foreignStore.symbol}`) + if (!isExternalErc20 && isGreaterThan(amount, foreignStore.maxCurrentDeposit)) { + alertStore.pushError( + `The amount is above current daily limit.\nThe max withdrawal today: ${ + foreignStore.maxCurrentDeposit + } ${foreignStore.symbol}` + ) return } - if(isGreaterThan(amount, foreignStore.balance)){ - alertStore.pushError(`Insufficient token balance. Your balance is ${foreignStore.balance} ${foreignStore.symbol}`) + if (isGreaterThan(amount, foreignStore.balance)) { + alertStore.pushError( + `Insufficient token balance. Your balance is ${foreignStore.balance} ${foreignStore.symbol}` + ) } else { try { alertStore.setLoading(true) @@ -139,18 +165,18 @@ export class Bridge extends React.Component { return await txStore.erc20transfer({ to: foreignStore.FOREIGN_BRIDGE_ADDRESS, from: web3Store.defaultAccount.address, - value: toDecimals(amount,foreignStore.tokenDecimals) + value: toDecimals(amount, foreignStore.tokenDecimals) }) } else { return await txStore.erc677transferAndCall({ to: foreignStore.FOREIGN_BRIDGE_ADDRESS, from: web3Store.defaultAccount.address, - value: toHex(toDecimals(amount,foreignStore.tokenDecimals)), + value: toHex(toDecimals(amount, foreignStore.tokenDecimals)), contract: foreignStore.tokenContract, tokenAddress: foreignStore.tokenAddress }) } - } catch(e) { + } catch (e) { console.error(e) } } @@ -160,19 +186,21 @@ export class Bridge extends React.Component { isGreaterThan = (amount, base) => new BN(amount).gt(new BN(base)) - onTransfer = async (e) => { + onTransfer = async e => { e.preventDefault() - const amount = this.state.amount.trim(); - if(!amount){ - swal("Error", "Please specify amount", "error") + const amount = this.state.amount.trim() + if (!amount) { + swal('Error', 'Please specify amount', 'error') return } const { foreignStore, web3Store, homeStore } = this.props.RootStore - if((web3Store.metamaskNotSetted && web3Store.metamaskNet.name === '') - || web3Store.defaultAccount.address === undefined) { + if ( + (web3Store.metamaskNotSetted && web3Store.metamaskNet.name === '') || + web3Store.defaultAccount.address === undefined + ) { web3Store.showInstallMetamaskAlert() return } @@ -185,7 +213,7 @@ export class Bridge extends React.Component { let finalAmount = new BN(amount) const feeToApply = getFeeToApply(homeStore.feeManager, foreignStore.feeManager, !reverse) - if(validFee(feeToApply)) { + if (validFee(feeToApply)) { fee = feeToApply.multipliedBy(100) finalAmount = finalAmount.multipliedBy(1 - feeToApply) } @@ -201,28 +229,31 @@ export class Bridge extends React.Component { reverse } - this.setState({ showConfirmation: true, confirmationData}) + this.setState({ showConfirmation: true, confirmationData }) } onTransferConfirmation = async () => { const { alertStore } = this.props.RootStore const { reverse } = this.state - this.setState({showConfirmation: false, confirmationData: {}}) - const amount = this.state.amount.trim(); - if(!amount){ - swal("Error", "Please specify amount", "error") + this.setState({ showConfirmation: false, confirmationData: {} }) + const amount = this.state.amount.trim() + if (!amount) { + swal('Error', 'Please specify amount', 'error') return } try { - if(reverse){ + if (reverse) { await this._sendToForeign(amount) } else { await this._sendToHome(amount) } - } catch(e) { - if(!e.message.includes('not mined within 50 blocks') && !e.message.includes('Failed to subscribe to new newBlockHeaders')) { + } catch (e) { + if ( + !e.message.includes('not mined within 50 blocks') && + !e.message.includes('Failed to subscribe to new newBlockHeaders') + ) { alertStore.setLoading(false) } } @@ -231,7 +262,8 @@ export class Bridge extends React.Component { loadHomeDetails = () => { const { web3Store, homeStore, bridgeMode } = this.props.RootStore const isErcToErcMode = bridgeMode === BRIDGE_MODES.ERC_TO_ERC - const isExternalErc20 = bridgeMode === BRIDGE_MODES.ERC_TO_ERC || bridgeMode === BRIDGE_MODES.ERC_TO_NATIVE + const isExternalErc20 = + bridgeMode === BRIDGE_MODES.ERC_TO_ERC || bridgeMode === BRIDGE_MODES.ERC_TO_NATIVE const modalData = { isHome: true, @@ -284,28 +316,24 @@ export class Bridge extends React.Component { this.setState({ modalData, showModal: true }) } - getNetworkTitle = (networkName) => { - - const index = networkName.indexOf(" ") + getNetworkTitle = networkName => { + const index = networkName.indexOf(' ') if (index === -1) { return networkName } return networkName.substring(0, index) - } - getNetworkSubTitle = (networkName) => { - - const index = networkName.indexOf(" ") + getNetworkSubTitle = networkName => { + const index = networkName.indexOf(' ') if (index === -1) { return false } return networkName.substring(index + 1, networkName.length) - } render() { @@ -313,11 +341,11 @@ export class Bridge extends React.Component { const { reverse, showModal, modalData, showConfirmation, confirmationData } = this.state const formCurrency = reverse ? foreignStore.symbol : homeStore.symbol - if(showModal && Object.keys(modalData).length !== 0) { - if(modalData.isHome && modalData.balance !== homeStore.getDisplayedBalance()) { + if (showModal && Object.keys(modalData).length !== 0) { + if (modalData.isHome && modalData.balance !== homeStore.getDisplayedBalance()) { modalData.balance = homeStore.getDisplayedBalance() - } else if(!modalData.isHome && modalData.balance !== foreignStore.balance) { - modalData.balance= foreignStore.balance + } else if (!modalData.isHome && modalData.balance !== foreignStore.balance) { + modalData.balance = foreignStore.balance } } @@ -326,13 +354,10 @@ export class Bridge extends React.Component { const foreignNetworkName = this.getNetworkTitle(foreignStore.networkName) const foreignNetworkSubtitle = this.getNetworkSubTitle(foreignStore.networkName) - return( + return (
- +
@@ -370,23 +395,23 @@ export class Bridge extends React.Component {
- + {this.setState({showModal: false})}} + hideModal={() => { + this.setState({ showModal: false }) + }} showModal={showModal} > - + - + {this.setState({showConfirmation: false, confirmationData: {}})}} - {...confirmationData} /> + onCancel={() => { + this.setState({ showConfirmation: false, confirmationData: {} }) + }} + {...confirmationData} + />
diff --git a/ui/src/components/BridgeAddress.js b/ui/src/components/BridgeAddress.js index 45e6c250..b4df2223 100644 --- a/ui/src/components/BridgeAddress.js +++ b/ui/src/components/BridgeAddress.js @@ -1,27 +1,30 @@ import React from 'react' export const BridgeAddress = ({ isHome, reverse }) => { - const getAddress = () => isHome ? - (
) - : - (
) + const getAddress = () => + isHome ? ( +
+ ) : ( +
+ ) - return isHome ? - (
+ return isHome ? ( +
{getAddress()} -
) - : - (
+
+ ) : ( +
{getAddress()}
-
) +
+ ) } diff --git a/ui/src/components/BridgeForm.js b/ui/src/components/BridgeForm.js index 203f72f3..f6a693a6 100644 --- a/ui/src/components/BridgeForm.js +++ b/ui/src/components/BridgeForm.js @@ -1,22 +1,27 @@ import React from 'react' -export const BridgeForm = ({ reverse, currency, onTransfer, onInputChange, displayArrow}) => ( -
+export const BridgeForm = ({ reverse, currency, onTransfer, onInputChange, displayArrow }) => ( +
- + onChange={onInputChange} + name="amount" + pattern="[0-9]+([.][0-9]{1,18})?" + type="text" + className="bridge-form-input" + id="amount" + placeholder="0" + /> +
- +
diff --git a/ui/src/components/BridgeNetwork.js b/ui/src/components/BridgeNetwork.js index 9290dee9..3c76ac04 100644 --- a/ui/src/components/BridgeNetwork.js +++ b/ui/src/components/BridgeNetwork.js @@ -16,28 +16,37 @@ export const BridgeNetwork = ({ ? numeral(0).format('0,0.00', Math.floor) : numeral(balance).format('0,0.00', Math.floor) - const showMore = () => isHome ? - (
- - Show More -
) - : - (
- Show More - -
) + const showMore = () => + isHome ? ( +
+ + + + Show More +
+ ) : ( +
+ Show More + + + +
+ ) return (
-

+

{networkTitle} {networkSubtitle ? {networkSubtitle} : null}

Balance: - {formattedBalance} {currency} + + {' '} + {formattedBalance} {currency} +

{showMore()}
- ) + ) } diff --git a/ui/src/components/BridgeStatistics.js b/ui/src/components/BridgeStatistics.js index 9ab8b64d..61adbf0e 100644 --- a/ui/src/components/BridgeStatistics.js +++ b/ui/src/components/BridgeStatistics.js @@ -2,13 +2,17 @@ import React from 'react' import numeral from 'numeral' import { DataBlock } from './DataBlock' -export const BridgeStatistics = ({ users, totalBridged, homeBalance, homeNativeSupplyTitle, foreignSupply, homeSymbol, foreignSymbol }) => ( +export const BridgeStatistics = ({ + users, + totalBridged, + homeBalance, + homeNativeSupplyTitle, + foreignSupply, + homeSymbol, + foreignSymbol +}) => (
- +
-); +) diff --git a/ui/src/components/Configuration.js b/ui/src/components/Configuration.js index ba99bffe..1e23c0d4 100644 --- a/ui/src/components/Configuration.js +++ b/ui/src/components/Configuration.js @@ -2,34 +2,34 @@ import React from 'react' import numeral from 'numeral' import { DataBlock } from './DataBlock' -export const Configuration = ({ requiredSignatures, authorities, symbol, maxSingleDeposit, maxTotalBalance }) => ( +export const Configuration = ({ + requiredSignatures, + authorities, + symbol, + maxSingleDeposit, + maxTotalBalance +}) => (
- - {maxSingleDeposit && maxSingleDeposit !== '0' - &&
- && + {maxSingleDeposit && maxSingleDeposit !== '0' &&
&& ( + - } - {maxSingleDeposit && maxSingleDeposit !== '0' - &&
- && && ( + - } + )}
-); +) diff --git a/ui/src/components/DailyQuotaModal.js b/ui/src/components/DailyQuotaModal.js index 2310b30c..44a9e293 100644 --- a/ui/src/components/DailyQuotaModal.js +++ b/ui/src/components/DailyQuotaModal.js @@ -1,9 +1,8 @@ import React from 'react' -import { inject, observer } from "mobx-react" +import { inject, observer } from 'mobx-react' import numeral from 'numeral' - -@inject("RootStore") +@inject('RootStore') @observer export class DailyQuotaModal extends React.Component { state = { @@ -17,11 +16,11 @@ export class DailyQuotaModal extends React.Component { getPosition = () => { const offsetsElement = document.getElementsByClassName('header-wallet') - if(offsetsElement.length > 0) { - const offsets = offsetsElement[0].getBoundingClientRect(); - const height = offsets.height; - const left = offsets.left; - this.setState({left, top: height + 20}) + if (offsetsElement.length > 0) { + const offsets = offsetsElement[0].getBoundingClientRect() + const height = offsets.height + const left = offsets.left + this.setState({ left, top: height + 20 }) } else { setTimeout(this.getPosition, 100) } @@ -38,18 +37,18 @@ export class DailyQuotaModal extends React.Component { const to = isHome ? foreignStore.symbol : homeStore.symbol const networkNameFrom = isHome ? homeStore.networkName : foreignStore.networkName const networkNameTo = isHome ? foreignStore.networkName : homeStore.networkName - const description = limit && limit !== '0' ? `${numeral(value).format('0,0.0', Math.floor)} ${from} on ${networkNameFrom + ' '} + const description = + limit && limit !== '0' + ? `${numeral(value).format('0,0.0', Math.floor)} ${from} on ${networkNameFrom + ' '} remaining for transfer to ${to + ' '} on ${networkNameTo}` - : `No limit configured` + : `No limit configured` return (
-
-
+
+
Daily Quota - - {description} - + {description}
diff --git a/ui/src/components/DataBlock.js b/ui/src/components/DataBlock.js index 1ebbd600..63982123 100644 --- a/ui/src/components/DataBlock.js +++ b/ui/src/components/DataBlock.js @@ -4,8 +4,8 @@ export const DataBlock = ({ description, value, type, dataTestid }) => (

{value} - {type} + {type}

{description}

-); +) diff --git a/ui/src/components/Disclaimer.js b/ui/src/components/Disclaimer.js index 159f50a1..79b36561 100644 --- a/ui/src/components/Disclaimer.js +++ b/ui/src/components/Disclaimer.js @@ -4,33 +4,45 @@ import disclaimerIcon from '../assets/images/disclaimer-modal/disclaimer@2x.png' export const Disclaimer = ({ onConfirmation }) => (
- disclaimer icon + disclaimer icon
- Welcome to the
TokenBridge UI App Beta+
+ + Welcome to the +
TokenBridge UI App Beta+ +

- We’re launching our TokenBridge and our UI App on a beta-testing basis. While we’ve - worked long and hard to develop the core features of the software, we expect that our - users may detect bugs and other issues. Help us improve by posting any difficulties to our - support page. -
-
- Use of this app and the TokenBridge is at your own risk. Users may experience - unexpected delays, unexpected visual artifacts, unexpected loss of tokens or funds from - improper app configuration, or other negative outcomes. -
-
+ We’re launching our TokenBridge and our UI App on a beta-testing basis. While we’ve worked + long and hard to develop the core features of the software, we expect that our users may + detect bugs and other issues. Help us improve by posting any difficulties to our + + {' '} + support page + + . +
+
+ Use of this app and the TokenBridge is at your own risk. Users may experience unexpected + delays, unexpected visual artifacts, unexpected loss of tokens or funds from improper app + configuration, or other negative outcomes. +
+
By hitting the "continue" button, you are representing that you’ve read our Terms of - Service in full, and that you agree to be legally bound by them. + target="_blank" + rel="noopener noreferrer" + > + Terms of Service + {' '} + in full, and that you agree to be legally bound by them.

-
diff --git a/ui/src/components/EventsListHeader.js b/ui/src/components/EventsListHeader.js index a1c363fe..c82d5869 100644 --- a/ui/src/components/EventsListHeader.js +++ b/ui/src/components/EventsListHeader.js @@ -1,11 +1,26 @@ import React from 'react' -export const EventsListHeader = ({selected, homeName, homeValue, foreignName, foreignValue, onChangeList, handleChange, handleKeyDown}) => ( +export const EventsListHeader = ({ + selected, + homeName, + homeValue, + foreignName, + foreignValue, + onChangeList, + handleChange, + handleKeyDown +}) => (
Events
- +