diff --git a/common/actions/swap.js b/common/actions/swap.js index b51e8db1..1bdd4b83 100644 --- a/common/actions/swap.js +++ b/common/actions/swap.js @@ -6,35 +6,35 @@ export const SWAP_DESTINATION_AMOUNT = 'SWAP_DESTINATION_AMOUNT'; export const SWAP_UPDATE_BITY_RATES = 'SWAP_UPDATE_BITY_RATES'; -export const SWAP_ORIGIN_KIND_TO = (value: any) => { +export const SWAP_ORIGIN_KIND_TO = (value) => { return { type: SWAP_ORIGIN_KIND, value }; }; -export const SWAP_DESTINATION_KIND_TO = (value: any) => { +export const SWAP_DESTINATION_KIND_TO = (value) => { return { type: SWAP_DESTINATION_KIND, value } } -export const SWAP_ORIGIN_AMOUNT_TO = (value: any) => { +export const SWAP_ORIGIN_AMOUNT_TO = (value) => { return { type: SWAP_ORIGIN_AMOUNT, value }; }; -export const SWAP_DESTINATION_AMOUNT_TO = (value: any) => { +export const SWAP_DESTINATION_AMOUNT_TO = (value) => { return { type: SWAP_DESTINATION_AMOUNT, value } } -export const SWAP_UPDATE_BITY_RATES_TO = (value: any) => { +export const SWAP_UPDATE_BITY_RATES_TO = (value) => { return { type: SWAP_UPDATE_BITY_RATES, value diff --git a/common/api/bity.js b/common/api/bity.js index b7b820c7..6b7f6b29 100644 --- a/common/api/bity.js +++ b/common/api/bity.js @@ -2,7 +2,7 @@ import axios from 'axios'; // https://stackoverflow.com/questions/9828684/how-to-get-all-arguments-of-a-callback-function export function combineAndUpper() { - let args = []; + const args = []; let newString = ''; for (let i = 0; i < arguments.length; ++i) args[i] = arguments[i]; args.forEach((each) => { @@ -36,8 +36,8 @@ export default class Bity { } _getRate(bityRates, origin, destination) { - let pairName = combineAndUpper(origin, destination); - let rateObjects = bityRates.data.objects; + const pairName = combineAndUpper(origin, destination); + const rateObjects = bityRates.data.objects; return this.findRateFromBityRateList(rateObjects, pairName); } @@ -46,14 +46,14 @@ export default class Bity { * @param arrayOfOriginAndDestinationDicts - [{origin: 'BTC', destination: 'ETH'}, {origin: 'BTC', destination: 'REP}] */ getMultipleRates(arrayOfOriginAndDestinationDicts) { - let mappedRates = {}; + const mappedRates = {}; return this.requestAllRates() .then((bityRates) => { arrayOfOriginAndDestinationDicts.forEach((each) => { - let origin = each.origin; - let destination = each.destination; - let pairName = combineAndUpper(origin, destination); - let rate = this._getRate(bityRates, origin, destination); + const origin = each.origin; + const destination = each.destination; + const pairName = combineAndUpper(origin, destination); + const rate = this._getRate(bityRates, origin, destination); mappedRates[pairName] = parseFloat(rate.rate_we_sell) }); return mappedRates @@ -62,11 +62,11 @@ export default class Bity { } getAllRates() { - let mappedRates = {}; + const mappedRates = {}; return this.requestAllRates() .then((bityRates) => { bityRates.data.objects.forEach((each) => { - let pairName = each.pair; + const pairName = each.pair; mappedRates[pairName] = parseFloat(each.rate_we_sell) }); return mappedRates @@ -75,8 +75,8 @@ export default class Bity { } requestAllRates() { - let path = '/v1/rate2/'; - let bityURL = this.bityAPI + path + const path = '/v1/rate2/'; + const bityURL = this.bityAPI + path; return axios.get(bityURL) } } diff --git a/common/containers/App/index.jsx b/common/containers/App/index.jsx index a018c1bf..4dea2e1f 100644 --- a/common/containers/App/index.jsx +++ b/common/containers/App/index.jsx @@ -27,11 +27,6 @@ class App extends Component { nodeSelection: PropTypes.object }; - componentWillMount() { - let { handleWindowResize } = this.props; - window.addEventListener('resize', handleWindowResize); - } - render() { let { children, @@ -41,11 +36,11 @@ class App extends Component { changeNode, nodeSelection } = this.props; - + let headerProps = { changeLanguage, languageSelection, - + location, changeNode, nodeSelection }; diff --git a/common/containers/Tabs/Swap/components/wantToSwapMy.js b/common/containers/Tabs/Swap/components/wantToSwapMy.js index f31e3ea8..21158372 100644 --- a/common/containers/Tabs/Swap/components/wantToSwapMy.js +++ b/common/containers/Tabs/Swap/components/wantToSwapMy.js @@ -79,7 +79,7 @@ export default class WantToSwapMy extends Component { } render() { - let { + const { originAmount, destinationAmount, originKind, @@ -90,7 +90,7 @@ export default class WantToSwapMy extends Component { return (
-

{translate('SWAP_init_1')}

+

{translate('SWAP_init_1')}

0) ? 'is-valid' : 'is-invalid'}`} diff --git a/common/reducers/swap.js b/common/reducers/swap.js index 8ef090f9..a40d133b 100644 --- a/common/reducers/swap.js +++ b/common/reducers/swap.js @@ -6,7 +6,7 @@ import { SWAP_UPDATE_BITY_RATES } from 'actions/swap'; -import {without} from 'lodash'; +import without from 'lodash/without'; const ALL_CRYPTO_KIND_OPTIONS = ['BTC', 'ETH', 'REP']; const initialState = {