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"
}
}
}
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
8 changes: 6 additions & 2 deletions packages/fether-react/src/Tokens/TokensList/TokensList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// SPDX-License-Identifier: BSD-3-Clause

import React, { Component } from 'react';

import defaultTokenImage from '../../assets/img/tokens/default-token-128x128.jpg';
Tbaut marked this conversation as resolved.
Show resolved Hide resolved
import RequireHealthOverlay from '../../RequireHealthOverlay';
import TokenBalance from './TokenBalance';
import withTokens from '../../utils/withTokens';
Expand All @@ -14,7 +16,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 All @@ -25,7 +26,10 @@ class TokensList extends Component {
index // With empty tokens, the token.address is not defined, so we prefix with index
) => (
<li key={`${index}-${token.address}`}>
<TokenBalance token={token} />
<TokenBalance
token={token}
defaultTokenImage={defaultTokenImage}
/>
</li>
))}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ class NewTokenItem extends Component {

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

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

@withTokens
Expand Down Expand Up @@ -131,7 +132,11 @@ class Whitelist extends Component {
</div>
<ul className='list -tokens'>
{displayedTokens.map(token => (
<NewTokenItem key={token.address} token={token} />
<NewTokenItem
key={token.address}
token={token}
defaultTokenImage={defaultTokenImage}
/>
))}
</ul>
</div>
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