Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Use new token contract's source #477

Merged
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@
"preelectron": "yarn build",
"electron": "cd packages/fether-electron && yarn electron",
"lint-files": "./scripts/lint-files.sh",
"lint": "yarn lint-files '**/*.{js,ts}'",
"lint": "yarn lint-files '**/*.js'",
"prepackage": "yarn build",
"package": "cd packages/fether-electron && yarn package",
"release": "cd packages/fether-electron && yarn release",
"start": "npm-run-all -l -p start-*",
"start-electron": "cd packages/fether-electron && yarn start",
"start-react": "cd packages/fether-react && yarn start",
"start-ui": "cd packages/fether-ui && yarn start",
"test": "semistandard '**/*.{js,ts}' --parser babel-eslint && CI=true lerna run test --parallel"
"test": "semistandard '**/*.js' --parser babel-eslint && CI=true lerna run test --parallel",
"update-tokens": "yarn run ts-node --project scripts/updateTokens/tsconfig.json scripts/updateTokens"
},
"husky": {
"hooks": {
Expand All @@ -71,6 +72,8 @@
"dependencies": {
"download": "^7.1.0",
"node-fetch": "^2.3.0",
"semver": "^5.6.0"
"semver": "^5.6.0",
"ts-node": "^8.0.3",
"typescript": "^3.3.4000"
}
}
}
81 changes: 0 additions & 81 deletions packages/fether-react/scripts/updateTokens.js

This file was deleted.

4 changes: 3 additions & 1 deletion packages/fether-react/src/Send/TxForm/TxForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import { OnChange } from 'react-final-form-listeners';
import { startWith } from 'rxjs/operators';
import { withProps } from 'recompose';

import { estimateGas } from '../../utils/transaction';
import Debug from '../../utils/debug';
import defaultTokenImage from '../../assets/img/tokens/default-token-128x128.jpg';
import { estimateGas } from '../../utils/transaction';
import RequireHealthOverlay from '../../RequireHealthOverlay';
import TokenBalance from '../../Tokens/TokensList/TokenBalance';
import TxDetails from './TxDetails';
Expand Down Expand Up @@ -364,6 +365,7 @@ class TxForm extends Component {
]}
onClick={null} // To disable cursor:pointer on card // TODO Can this be done better?
token={token}
defaultTokenImage={defaultTokenImage}
Tbaut marked this conversation as resolved.
Show resolved Hide resolved
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
//
// SPDX-License-Identifier: BSD-3-Clause

import React, { Component } from 'react';
import { inject } from 'mobx-react';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { TokenCard } from 'fether-ui';
import { withRouter } from 'react-router-dom';

import defaultTokenImage from '../../../assets/img/tokens/default-token-128x128.jpg';
import withAccount from '../../../utils/withAccount';
import withBalance from '../../../utils/withBalance';

Expand Down Expand Up @@ -38,7 +39,13 @@ class TokenBalance extends Component {
};

render () {
return <TokenCard onClick={this.handleClick} {...this.props} />;
return (
<TokenCard
onClick={this.handleClick}
defaultTokenImage={defaultTokenImage}
{...this.props}
/>
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/fether-react/src/Tokens/TokensList/TokensList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// SPDX-License-Identifier: BSD-3-Clause

import React, { Component } from 'react';

import RequireHealthOverlay from '../../RequireHealthOverlay';
import TokenBalance from './TokenBalance';
import withTokens from '../../utils/withTokens';
Expand All @@ -14,7 +15,6 @@ class TokensList extends Component {
const { tokensArray } = this.props;
// Show empty token placeholder if tokens have not been loaded yet
const shownArray = tokensArray.length ? tokensArray : [{}];

return (
<RequireHealthOverlay require='sync'>
<div className='window_content'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import React, { Component } from 'react';
import { TokenCard } from 'fether-ui';
import { withRouter } from 'react-router-dom';

import defaultTokenImage from '../../assets/img/tokens/default-token-128x128.jpg';
import withTokens from '../../utils/withTokens';

@withRouter
Expand All @@ -29,7 +30,13 @@ class NewTokenItem extends Component {

return (
<li key={token.address}>
<TokenCard balance={null} showBalance={false} token={token}>
<TokenCard
balance={null}
defaultTokenImage={defaultTokenImage}
showBalance={false}
token={token}
{...this.props}
>
<div className='token_buttons'>
{tokens[token.address] ? (
<button
Expand Down
2 changes: 1 addition & 1 deletion packages/fether-react/src/Whitelist/Whitelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { Header } from 'fether-ui';
import light from '@parity/light.js-react';
import { Link } from 'react-router-dom';

import RequireHealthOverlay from '../RequireHealthOverlay';
import Health from '../Health';
import NewTokenItem from './NewTokenItem';
import RequireHealthOverlay from '../RequireHealthOverlay';
import withTokens from '../utils/withTokens';

@withTokens
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading