Fix website unused vars
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
BlockParam,
|
||||
DecodedLogEvent,
|
||||
ExchangeContractErrs,
|
||||
ExchangeContractEventArgs,
|
||||
ExchangeEvents,
|
||||
IndexedFilterValues,
|
||||
@@ -14,7 +13,6 @@ import {
|
||||
Token as ZeroExToken,
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
ZeroEx,
|
||||
ZeroExError,
|
||||
} from '0x.js';
|
||||
import {
|
||||
InjectedWeb3Subprovider,
|
||||
@@ -25,9 +23,6 @@ import {
|
||||
} from '@0xproject/subproviders';
|
||||
import {intervalUtils, promisify} from '@0xproject/utils';
|
||||
import BigNumber from 'bignumber.js';
|
||||
import compareVersions = require('compare-versions');
|
||||
import ethUtil = require('ethereumjs-util');
|
||||
import findVersions = require('find-versions');
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import contract = require('truffle-contract');
|
||||
@@ -40,7 +35,6 @@ import {
|
||||
BlockchainCallErrs,
|
||||
BlockchainErrs,
|
||||
ContractInstance,
|
||||
ContractResponse,
|
||||
EtherscanLinkSuffixes,
|
||||
ProviderType,
|
||||
Side,
|
||||
@@ -60,7 +54,6 @@ import FilterSubprovider = require('web3-provider-engine/subproviders/filters');
|
||||
|
||||
import * as MintableArtifacts from '../contracts/Mintable.json';
|
||||
|
||||
const ALLOWANCE_TO_ZERO_GAS_AMOUNT = 45730;
|
||||
const BLOCK_NUMBER_BACK_TRACK = 50;
|
||||
|
||||
export class Blockchain {
|
||||
@@ -70,8 +63,6 @@ export class Blockchain {
|
||||
private dispatcher: Dispatcher;
|
||||
private web3Wrapper?: Web3Wrapper;
|
||||
private exchangeAddress: string;
|
||||
private tokenTransferProxy: ContractInstance;
|
||||
private tokenRegistry: ContractInstance;
|
||||
private userAddress: string;
|
||||
private cachedProvider: Web3.Provider;
|
||||
private ledgerSubprovider: LedgerWalletSubprovider;
|
||||
@@ -506,8 +497,7 @@ export class Blockchain {
|
||||
await this.fetchHistoricalExchangeLogFillEventsAsync(indexFilterValues);
|
||||
|
||||
// Start a subscription for new logs
|
||||
const exchangeAddress = this.getExchangeContractAddressIfExists();
|
||||
const subscriptionId = this.zeroEx.exchange.subscribe(
|
||||
this.zeroEx.exchange.subscribe(
|
||||
ExchangeEvents.LogFill, indexFilterValues,
|
||||
async (err: Error, decodedLogEvent: DecodedLogEvent<LogFillContractEventArgs>) => {
|
||||
if (err) {
|
||||
|
||||
@@ -2,7 +2,6 @@ import Dialog from 'material-ui/Dialog';
|
||||
import FlatButton from 'material-ui/FlatButton';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
|
||||
interface PortalDisclaimerDialogProps {
|
||||
isOpen: boolean;
|
||||
|
||||
@@ -2,13 +2,10 @@ import BigNumber from 'bignumber.js';
|
||||
import * as _ from 'lodash';
|
||||
import Dialog from 'material-ui/Dialog';
|
||||
import FlatButton from 'material-ui/FlatButton';
|
||||
import RadioButton from 'material-ui/RadioButton';
|
||||
import RadioButtonGroup from 'material-ui/RadioButton/RadioButtonGroup';
|
||||
import * as React from 'react';
|
||||
import {AddressInput} from 'ts/components/inputs/address_input';
|
||||
import {EthAmountInput} from 'ts/components/inputs/eth_amount_input';
|
||||
import {TokenAmountInput} from 'ts/components/inputs/token_amount_input';
|
||||
import {Side, Token, TokenState} from 'ts/types';
|
||||
import {Token, TokenState} from 'ts/types';
|
||||
|
||||
interface SendDialogProps {
|
||||
onComplete: (recipient: string, value: BigNumber) => void;
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import * as _ from 'lodash';
|
||||
import Dialog from 'material-ui/Dialog';
|
||||
import FlatButton from 'material-ui/FlatButton';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {Blockchain} from 'ts/blockchain';
|
||||
import {TrackTokenConfirmation} from 'ts/components/track_token_confirmation';
|
||||
import {trackedTokenStorage} from 'ts/local_storage/tracked_token_storage';
|
||||
import {Dispatcher} from 'ts/redux/dispatcher';
|
||||
import {Token, TokenByAddress} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
|
||||
interface TrackTokenConfirmationDialogProps {
|
||||
tokens: Token[];
|
||||
|
||||
@@ -4,10 +4,7 @@ import BigNumber from 'bignumber.js';
|
||||
import * as _ from 'lodash';
|
||||
import {Card, CardHeader, CardText} from 'material-ui/Card';
|
||||
import Divider from 'material-ui/Divider';
|
||||
import Paper from 'material-ui/Paper';
|
||||
import RaisedButton from 'material-ui/RaisedButton';
|
||||
import TextField from 'material-ui/TextField';
|
||||
import * as moment from 'moment';
|
||||
import * as React from 'react';
|
||||
import {Link} from 'react-router-dom';
|
||||
import {Blockchain} from 'ts/blockchain';
|
||||
@@ -19,18 +16,13 @@ import {Alert} from 'ts/components/ui/alert';
|
||||
import {EthereumAddress} from 'ts/components/ui/ethereum_address';
|
||||
import {Identicon} from 'ts/components/ui/identicon';
|
||||
import {VisualOrder} from 'ts/components/visual_order';
|
||||
import {trackedTokenStorage} from 'ts/local_storage/tracked_token_storage';
|
||||
import {Dispatcher} from 'ts/redux/dispatcher';
|
||||
import {orderSchema} from 'ts/schemas/order_schema';
|
||||
import {SchemaValidator} from 'ts/schemas/validator';
|
||||
import {
|
||||
AlertTypes,
|
||||
BlockchainErrs,
|
||||
ContractResponse,
|
||||
ExchangeContractErrs,
|
||||
Order,
|
||||
OrderToken,
|
||||
Side,
|
||||
Token,
|
||||
TokenByAddress,
|
||||
TokenStateByAddress,
|
||||
@@ -531,8 +523,6 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
|
||||
});
|
||||
|
||||
const parsedOrder = this.state.parsedOrder;
|
||||
const orderHash = parsedOrder.signature.hash;
|
||||
const unavailableTakerAmount = await this.props.blockchain.getUnavailableTakerAmountAsync(orderHash);
|
||||
const takerFillAmount = this.props.orderFillAmount;
|
||||
|
||||
if (_.isUndefined(this.props.userAddress)) {
|
||||
|
||||
@@ -3,11 +3,7 @@ import * as React from 'react';
|
||||
import {
|
||||
Link,
|
||||
} from 'react-router-dom';
|
||||
import {HashLink} from 'react-router-hash-link';
|
||||
import {
|
||||
Link as ScrollLink,
|
||||
} from 'react-scroll';
|
||||
import {Styles, WebsitePaths} from 'ts/types';
|
||||
import {WebsitePaths} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
|
||||
interface MenuItemsBySection {
|
||||
@@ -229,31 +225,4 @@ export class Footer extends React.Component<FooterProps, FooterState> {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
private renderHomepageLink(title: string) {
|
||||
const hash = title.toLowerCase();
|
||||
if (this.props.location.pathname === WebsitePaths.Home) {
|
||||
return (
|
||||
<ScrollLink
|
||||
style={linkStyle}
|
||||
to={hash}
|
||||
smooth={true}
|
||||
offset={0}
|
||||
duration={constants.HOME_SCROLL_DURATION_MS}
|
||||
containerId="home"
|
||||
>
|
||||
{title}
|
||||
</ScrollLink>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<HashLink
|
||||
to={`/#${hash}`}
|
||||
className="text-decoration-none"
|
||||
style={linkStyle}
|
||||
>
|
||||
{title}
|
||||
</HashLink>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import Dialog from 'material-ui/Dialog';
|
||||
import FlatButton from 'material-ui/FlatButton';
|
||||
import GridList from 'material-ui/GridList/GridList';
|
||||
import GridTile from 'material-ui/GridList/GridTile';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {Blockchain} from 'ts/blockchain';
|
||||
import {NewTokenForm} from 'ts/components/generate_order/new_token_form';
|
||||
@@ -12,15 +9,12 @@ import {TokenIcon} from 'ts/components/ui/token_icon';
|
||||
import {trackedTokenStorage} from 'ts/local_storage/tracked_token_storage';
|
||||
import {Dispatcher} from 'ts/redux/dispatcher';
|
||||
import {
|
||||
AssetToken,
|
||||
DialogConfigs,
|
||||
Styles,
|
||||
Token,
|
||||
TokenByAddress,
|
||||
TokenState,
|
||||
TokenVisibility,
|
||||
} from 'ts/types';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
const TOKEN_ICON_DIMENSION = 100;
|
||||
const TILE_DIMENSION = 146;
|
||||
@@ -219,21 +213,6 @@ export class AssetPicker extends React.Component<AssetPickerProps, AssetPickerSt
|
||||
});
|
||||
}
|
||||
}
|
||||
private getTitle() {
|
||||
switch (this.state.assetView) {
|
||||
case AssetViews.ASSET_PICKER:
|
||||
return 'Select token';
|
||||
|
||||
case AssetViews.NEW_TOKEN_FORM:
|
||||
return 'Add an ERC20 token';
|
||||
|
||||
case AssetViews.CONFIRM_TRACK_TOKEN:
|
||||
return 'Tracking confirmation';
|
||||
|
||||
default:
|
||||
throw utils.spawnSwitchErr('assetView', this.state.assetView);
|
||||
}
|
||||
}
|
||||
private onCustomAssetChosen() {
|
||||
this.setState({
|
||||
assetView: AssetViews.NEW_TOKEN_FORM,
|
||||
|
||||
@@ -62,16 +62,7 @@ interface GenerateOrderFormState {
|
||||
signingState: SigningState;
|
||||
}
|
||||
|
||||
const style = {
|
||||
paper: {
|
||||
display: 'inline-block',
|
||||
position: 'relative',
|
||||
textAlign: 'center',
|
||||
width: '100%',
|
||||
},
|
||||
};
|
||||
|
||||
export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, any> {
|
||||
export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, GenerateOrderFormState> {
|
||||
private validator: SchemaValidator;
|
||||
constructor(props: GenerateOrderFormProps) {
|
||||
super(props);
|
||||
@@ -287,7 +278,7 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, a
|
||||
if (_.isUndefined(exchangeContractAddr)) {
|
||||
this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
|
||||
this.setState({
|
||||
isSigning: false,
|
||||
signingState: SigningState.UNSIGNED,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import {Alert} from 'ts/components/ui/alert';
|
||||
import {LifeCycleRaisedButton} from 'ts/components/ui/lifecycle_raised_button';
|
||||
import {RequiredLabel} from 'ts/components/ui/required_label';
|
||||
import {AlertTypes, Token, TokenByAddress, TokenState} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
|
||||
interface NewTokenFormProps {
|
||||
blockchain: Blockchain;
|
||||
|
||||
@@ -3,7 +3,6 @@ import * as _ from 'lodash';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import TextField from 'material-ui/TextField';
|
||||
import * as React from 'react';
|
||||
import {Blockchain} from 'ts/blockchain';
|
||||
import {RequiredLabel} from 'ts/components/ui/required_label';
|
||||
|
||||
interface AddressInputProps {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import * as _ from 'lodash';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {Blockchain} from 'ts/blockchain';
|
||||
import {AddressInput} from 'ts/components/inputs/address_input';
|
||||
import {Identicon} from 'ts/components/ui/identicon';
|
||||
import {InputLabel} from 'ts/components/ui/input_label';
|
||||
|
||||
@@ -7,7 +7,7 @@ import {AssetPicker} from 'ts/components/generate_order/asset_picker';
|
||||
import {InputLabel} from 'ts/components/ui/input_label';
|
||||
import {TokenIcon} from 'ts/components/ui/token_icon';
|
||||
import {Dispatcher} from 'ts/redux/dispatcher';
|
||||
import {AssetToken, BlockchainErrs, Side, Token, TokenByAddress, TokenState} from 'ts/types';
|
||||
import {AssetToken, BlockchainErrs, Side, Token, TokenByAddress} from 'ts/types';
|
||||
|
||||
const TOKEN_ICON_DIMENSION = 80;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import BigNumber from 'bignumber.js';
|
||||
import * as _ from 'lodash';
|
||||
import Paper from 'material-ui/Paper';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import TextField from 'material-ui/TextField';
|
||||
import * as React from 'react';
|
||||
import {CopyIcon} from 'ts/components/ui/copy_icon';
|
||||
import {Order, SideToAssetToken, SignatureData, TokenByAddress, WebsitePaths} from 'ts/types';
|
||||
import {SideToAssetToken, SignatureData, TokenByAddress, WebsitePaths} from 'ts/types';
|
||||
import {configs} from 'ts/utils/configs';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {errorReporter} from 'ts/utils/error_reporter';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import BigNumber from 'bignumber.js';
|
||||
import * as _ from 'lodash';
|
||||
import Paper from 'material-ui/Paper';
|
||||
import RaisedButton from 'material-ui/RaisedButton';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import * as DocumentTitle from 'react-document-title';
|
||||
@@ -20,17 +19,13 @@ import {Loading} from 'ts/components/ui/loading';
|
||||
import {GenerateOrderForm} from 'ts/containers/generate_order_form';
|
||||
import {localStorage} from 'ts/local_storage/local_storage';
|
||||
import {Dispatcher} from 'ts/redux/dispatcher';
|
||||
import {State} from 'ts/redux/reducer';
|
||||
import {orderSchema} from 'ts/schemas/order_schema';
|
||||
import {SchemaValidator} from 'ts/schemas/validator';
|
||||
import {
|
||||
BlockchainErrs,
|
||||
Fill,
|
||||
HashData,
|
||||
Order,
|
||||
ScreenWidths,
|
||||
Side,
|
||||
Styles,
|
||||
Token,
|
||||
TokenByAddress,
|
||||
TokenStateByAddress,
|
||||
@@ -70,28 +65,6 @@ interface PortalAllState {
|
||||
hasAcceptedDisclaimer: boolean;
|
||||
}
|
||||
|
||||
const styles: Styles = {
|
||||
button: {
|
||||
color: 'white',
|
||||
},
|
||||
headline: {
|
||||
fontSize: 20,
|
||||
fontWeight: 400,
|
||||
marginBottom: 12,
|
||||
paddingTop: 16,
|
||||
},
|
||||
inkBar: {
|
||||
background: colors.amber600,
|
||||
},
|
||||
menuItem: {
|
||||
padding: '0px 16px 0px 48px',
|
||||
},
|
||||
tabItemContainer: {
|
||||
background: colors.blueGrey500,
|
||||
borderRadius: '4px 4px 0 0',
|
||||
},
|
||||
};
|
||||
|
||||
export class Portal extends React.Component<PortalAllProps, PortalAllState> {
|
||||
private blockchain: Blockchain;
|
||||
private sharedOrderIfExists: Order;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import {Link} from 'react-router-dom';
|
||||
import {MenuItem} from 'ts/components/ui/menu_item';
|
||||
import {WebsitePaths} from 'ts/types';
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import {ZeroEx} from '0x.js';
|
||||
import BigNumber from 'bignumber.js';
|
||||
import * as _ from 'lodash';
|
||||
import RaisedButton from 'material-ui/RaisedButton';
|
||||
@@ -7,7 +6,6 @@ import {Blockchain} from 'ts/blockchain';
|
||||
import {SendDialog} from 'ts/components/dialogs/send_dialog';
|
||||
import {Dispatcher} from 'ts/redux/dispatcher';
|
||||
import {BlockchainCallErrs, Token, TokenState} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {errorReporter} from 'ts/utils/error_reporter';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
TableRow,
|
||||
TableRowColumn,
|
||||
} from 'material-ui/Table';
|
||||
import QueryString = require('query-string');
|
||||
import * as React from 'react';
|
||||
import ReactTooltip = require('react-tooltip');
|
||||
import firstBy = require('thenby');
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
import * as _ from 'lodash';
|
||||
import AppBar from 'material-ui/AppBar';
|
||||
import Drawer from 'material-ui/Drawer';
|
||||
import MenuItem from 'material-ui/MenuItem';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {Link} from 'react-router-dom';
|
||||
import {HashLink} from 'react-router-hash-link';
|
||||
import {
|
||||
animateScroll,
|
||||
Link as ScrollLink,
|
||||
} from 'react-scroll';
|
||||
import ReactTooltip = require('react-tooltip');
|
||||
import {PortalMenu} from 'ts/components/portal_menu';
|
||||
import {TopBarMenuItem} from 'ts/components/top_bar_menu_item';
|
||||
@@ -17,10 +11,8 @@ import {DropDownMenuItem} from 'ts/components/ui/drop_down_menu_item';
|
||||
import {Identicon} from 'ts/components/ui/identicon';
|
||||
import {DocsInfo} from 'ts/pages/documentation/docs_info';
|
||||
import {NestedSidebarMenu} from 'ts/pages/shared/nested_sidebar_menu';
|
||||
import {DocsMenu, MenuSubsectionsBySection, Styles, TypeDocNode, WebsitePaths} from 'ts/types';
|
||||
import {configs} from 'ts/utils/configs';
|
||||
import {DocsMenu, MenuSubsectionsBySection, Styles, WebsitePaths} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {typeDocUtils} from 'ts/utils/typedoc_utils';
|
||||
|
||||
const CUSTOM_DARK_GRAY = '#231F20';
|
||||
const SECTION_HEADER_COLOR = 'rgb(234, 234, 234)';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import {Link} from 'react-router-dom';
|
||||
import {Styles} from 'ts/types';
|
||||
|
||||
const CUSTOM_DARK_GRAY = '#231F20';
|
||||
const DEFAULT_STYLE = {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import Dialog from 'material-ui/Dialog';
|
||||
import FlatButton from 'material-ui/FlatButton';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {Party} from 'ts/components/ui/party';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {Styles} from 'ts/types';
|
||||
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
import * as _ from 'lodash';
|
||||
import Menu from 'material-ui/Menu';
|
||||
import MenuItem from 'material-ui/MenuItem';
|
||||
import Popover from 'material-ui/Popover';
|
||||
import * as React from 'react';
|
||||
import {Link} from 'react-router-dom';
|
||||
import {
|
||||
Link as ScrollLink,
|
||||
} from 'react-scroll';
|
||||
import {Styles, WebsitePaths} from 'ts/types';
|
||||
|
||||
const CHECK_CLOSE_POPOVER_INTERVAL_MS = 300;
|
||||
const CUSTOM_LIGHT_GRAY = '#848484';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {InputLabel} from 'ts/components/ui/input_label';
|
||||
import {Styles} from 'ts/types';
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import RaisedButton from 'material-ui/RaisedButton';
|
||||
import * as React from 'react';
|
||||
import {Blockchain} from 'ts/blockchain';
|
||||
import {Token} from 'ts/types';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
const COMPLETE_STATE_SHOW_LENGTH_MS = 2000;
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {Link} from 'react-router-dom';
|
||||
import {Styles} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
|
||||
interface MenuItemProps {
|
||||
to: string;
|
||||
|
||||
@@ -7,7 +7,6 @@ import {Identicon} from 'ts/components/ui/identicon';
|
||||
import {EtherscanLinkSuffixes} from 'ts/types';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
const MIN_ADDRESS_WIDTH = 60;
|
||||
const IMAGE_DIMENSION = 100;
|
||||
const IDENTICON_DIAMETER = 95;
|
||||
const CHECK_MARK_GREEN = 'rgb(0, 195, 62)';
|
||||
@@ -33,10 +32,7 @@ export class Party extends React.Component<PartyProps, PartyState> {
|
||||
public render() {
|
||||
const label = this.props.label;
|
||||
const address = this.props.address;
|
||||
const tooltipId = `${label}-${address}-tooltip`;
|
||||
const identiconDiameter = this.props.identiconDiameter;
|
||||
const addressWidth = identiconDiameter > MIN_ADDRESS_WIDTH ?
|
||||
identiconDiameter : MIN_ADDRESS_WIDTH;
|
||||
const emptyIdenticonStyles = {
|
||||
width: identiconDiameter,
|
||||
height: identiconDiameter,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import CircularProgress from 'material-ui/CircularProgress';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
|
||||
export interface SimpleLoadingProps {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
|
||||
interface SwapIconProps {
|
||||
swapTokensFn: () => void;
|
||||
|
||||
@@ -3,7 +3,6 @@ import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import {Party} from 'ts/components/ui/party';
|
||||
import {AssetToken, Token, TokenByAddress} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
const PRECISION = 5;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import BigNumber from 'bignumber.js';
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import {Dispatch, Store as ReduxStore} from 'redux';
|
||||
import {Blockchain} from 'ts/blockchain';
|
||||
import {Dispatch} from 'redux';
|
||||
import {DocsInfo} from 'ts/pages/documentation/docs_info';
|
||||
import {
|
||||
Documentation as DocumentationComponent,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import BigNumber from 'bignumber.js';
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import {Dispatch, Store as ReduxStore} from 'redux';
|
||||
import {Blockchain} from 'ts/blockchain';
|
||||
import {GenerateOrderForm as GenerateOrderFormComponent} from 'ts/components/generate_order/generate_order_form';
|
||||
import {Dispatcher} from 'ts/redux/dispatcher';
|
||||
|
||||
@@ -2,7 +2,7 @@ import BigNumber from 'bignumber.js';
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import {Dispatch, Store as ReduxStore} from 'redux';
|
||||
import {Dispatch} from 'redux';
|
||||
import {
|
||||
Portal as PortalComponent,
|
||||
PortalAllProps as PortalComponentAllProps,
|
||||
@@ -12,7 +12,6 @@ import {Dispatcher} from 'ts/redux/dispatcher';
|
||||
import {State} from 'ts/redux/reducer';
|
||||
import {
|
||||
BlockchainErrs,
|
||||
Fill,
|
||||
HashData,
|
||||
Order,
|
||||
ScreenWidths,
|
||||
@@ -22,24 +21,23 @@ import {
|
||||
} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
|
||||
interface MapStateToProps {
|
||||
interface ConnectedState {
|
||||
blockchainErr: BlockchainErrs;
|
||||
blockchainIsLoaded: boolean;
|
||||
hashData: HashData;
|
||||
networkId: number;
|
||||
nodeVersion: string;
|
||||
orderFillAmount: number;
|
||||
orderFillAmount: BigNumber;
|
||||
tokenByAddress: TokenByAddress;
|
||||
tokenStateByAddress: TokenStateByAddress;
|
||||
userEtherBalance: number;
|
||||
userEtherBalance: BigNumber;
|
||||
screenWidth: ScreenWidths;
|
||||
shouldBlockchainErrDialogBeOpen: boolean;
|
||||
userAddress: string;
|
||||
userSuppliedOrderCache: Order;
|
||||
flashMessage?: string|React.ReactNode;
|
||||
}
|
||||
|
||||
interface ConnectedState {}
|
||||
|
||||
interface ConnectedDispatch {
|
||||
dispatcher: Dispatcher;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import {Dispatch, Store as ReduxStore} from 'redux';
|
||||
import {Dispatch} from 'redux';
|
||||
import {DocsInfo} from 'ts/pages/documentation/docs_info';
|
||||
import {
|
||||
Documentation as DocumentationComponent,
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import BigNumber from 'bignumber.js';
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import {connect} from 'react-redux';
|
||||
import {Dispatch, Store as ReduxStore} from 'redux';
|
||||
import {Blockchain} from 'ts/blockchain';
|
||||
import {Dispatch} from 'redux';
|
||||
import {DocsInfo} from 'ts/pages/documentation/docs_info';
|
||||
import {
|
||||
Documentation as DocumentationComponent,
|
||||
|
||||
@@ -6,7 +6,7 @@ import {colors, getMuiTheme, MuiThemeProvider} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {render} from 'react-dom';
|
||||
import {Provider} from 'react-redux';
|
||||
import {BrowserRouter as Router, Link, Redirect, Route, Switch} from 'react-router-dom';
|
||||
import {BrowserRouter as Router, Redirect, Route, Switch} from 'react-router-dom';
|
||||
import * as injectTapEventPlugin from 'react-tap-event-plugin';
|
||||
import {createStore, Store as ReduxStore} from 'redux';
|
||||
import {createLazyComponent} from 'ts/lazy_component';
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
import * as _ from 'lodash';
|
||||
import RaisedButton from 'material-ui/RaisedButton';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import * as DocumentTitle from 'react-document-title';
|
||||
import {Link} from 'react-router-dom';
|
||||
import {Footer} from 'ts/components/footer';
|
||||
import {TopBar} from 'ts/components/top_bar';
|
||||
import {Profile} from 'ts/pages/about/profile';
|
||||
import {Question} from 'ts/pages/faq/question';
|
||||
import {ProfileInfo, Styles} from 'ts/types';
|
||||
import {configs} from 'ts/utils/configs';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
@@ -236,7 +232,7 @@ export class About extends React.Component<AboutProps, AboutState> {
|
||||
}
|
||||
private renderProfiles(profiles: ProfileInfo[]) {
|
||||
const numIndiv = profiles.length;
|
||||
const colSize = utils.getColSize(profiles.length);
|
||||
const colSize = utils.getColSize(numIndiv);
|
||||
return _.map(profiles, profile => {
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {Element as ScrollElement} from 'react-scroll';
|
||||
import {ProfileInfo, Styles} from 'ts/types';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
const IMAGE_DIMENSION = 149;
|
||||
const styles: Styles = {
|
||||
|
||||
@@ -22,3 +22,5 @@ export const Comment: React.SFC<CommentProps> = (props: CommentProps) => {
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Comment.defaultProps = defaultProps;
|
||||
|
||||
@@ -17,35 +17,27 @@ import {MethodBlock} from 'ts/pages/documentation/method_block';
|
||||
import {SourceLink} from 'ts/pages/documentation/source_link';
|
||||
import {Type} from 'ts/pages/documentation/type';
|
||||
import {TypeDefinition} from 'ts/pages/documentation/type_definition';
|
||||
import {AnchorTitle} from 'ts/pages/shared/anchor_title';
|
||||
import {MarkdownSection} from 'ts/pages/shared/markdown_section';
|
||||
import {NestedSidebarMenu} from 'ts/pages/shared/nested_sidebar_menu';
|
||||
import {SectionHeader} from 'ts/pages/shared/section_header';
|
||||
import {Dispatcher} from 'ts/redux/dispatcher';
|
||||
import {
|
||||
AddressByContractName,
|
||||
CustomType,
|
||||
DocAgnosticFormat,
|
||||
Docs,
|
||||
DocsInfoConfig,
|
||||
DoxityDocObj,
|
||||
EtherscanLinkSuffixes,
|
||||
Event,
|
||||
MenuSubsectionsBySection,
|
||||
Networks,
|
||||
Property,
|
||||
SolidityMethod,
|
||||
Styles,
|
||||
TypeDefinitionByName,
|
||||
TypeDocNode,
|
||||
TypescriptMethod,
|
||||
WebsitePaths,
|
||||
} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {docUtils} from 'ts/utils/doc_utils';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
const SCROLL_TO_TIMEOUT = 500;
|
||||
const SCROLL_TOP_ID = 'docsScrollTop';
|
||||
const CUSTOM_PURPLE = '#690596';
|
||||
const CUSTOM_RED = '#e91751';
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import {EnumValue, TypeDocNode} from 'ts/types';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
const STRING_ENUM_CODE_PREFIX = ' strEnum(';
|
||||
import {EnumValue} from 'ts/types';
|
||||
|
||||
interface EnumProps {
|
||||
values: EnumValue[];
|
||||
@@ -11,7 +8,6 @@ interface EnumProps {
|
||||
|
||||
export function Enum(props: EnumProps) {
|
||||
const values = _.map(props.values, (value, i) => {
|
||||
const isLast = i === props.values.length - 1;
|
||||
const defaultValueIfAny = !_.isUndefined(value.defaultValue) ? ` = ${value.defaultValue}` : '';
|
||||
return `\n\t${value.name}${defaultValueIfAny},`;
|
||||
});
|
||||
|
||||
@@ -4,10 +4,7 @@ import {DocsInfo} from 'ts/pages/documentation/docs_info';
|
||||
import {Type} from 'ts/pages/documentation/type';
|
||||
import {AnchorTitle} from 'ts/pages/shared/anchor_title';
|
||||
import {Event, EventArg, HeaderSizes} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
const KEYWORD_COLOR = '#a81ca6';
|
||||
const CUSTOM_GREEN = 'rgb(77, 162, 75)';
|
||||
|
||||
interface EventDefinitionProps {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import * as _ from 'lodash';
|
||||
import {Chip} from 'material-ui/Chip';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import * as ReactMarkdown from 'react-markdown';
|
||||
import {Comment} from 'ts/pages/documentation/comment';
|
||||
import {DocsInfo} from 'ts/pages/documentation/docs_info';
|
||||
import {MethodSignature} from 'ts/pages/documentation/method_signature';
|
||||
@@ -14,11 +12,9 @@ import {
|
||||
SolidityMethod,
|
||||
Styles,
|
||||
TypeDefinitionByName,
|
||||
TypeDocNode,
|
||||
TypescriptMethod,
|
||||
} from 'ts/types';
|
||||
import {typeDocUtils} from 'ts/utils/typedoc_utils';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
interface MethodBlockProps {
|
||||
method: SolidityMethod|TypescriptMethod;
|
||||
|
||||
@@ -42,6 +42,8 @@ export const MethodSignature: React.SFC<MethodSignatureProps> = (props: MethodSi
|
||||
);
|
||||
};
|
||||
|
||||
MethodSignature.defaultProps = defaultProps;
|
||||
|
||||
function renderParameters(
|
||||
method: TypescriptMethod|SolidityMethod, docsInfo: DocsInfo, typeDefinitionByName?: TypeDefinitionByName,
|
||||
) {
|
||||
|
||||
@@ -2,7 +2,6 @@ import * as _ from 'lodash';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {Source} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
|
||||
interface SourceLinkProps {
|
||||
source: Source;
|
||||
|
||||
@@ -7,7 +7,6 @@ import {DocsInfo} from 'ts/pages/documentation/docs_info';
|
||||
import {TypeDefinition} from 'ts/pages/documentation/type_definition';
|
||||
import {Type as TypeDef, TypeDefinitionByName, TypeDocTypes} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {typeDocUtils} from 'ts/utils/typedoc_utils';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
const BUILT_IN_TYPE_COLOR = '#e69d00';
|
||||
@@ -48,10 +47,8 @@ interface TypeProps {
|
||||
// <Type /> components (e.g when rendering the union type).
|
||||
export function Type(props: TypeProps): any {
|
||||
const type = props.type;
|
||||
const isIntrinsic = type.typeDocType === TypeDocTypes.Intrinsic;
|
||||
const isReference = type.typeDocType === TypeDocTypes.Reference;
|
||||
const isArray = type.typeDocType === TypeDocTypes.Array;
|
||||
const isStringLiteral = type.typeDocType === TypeDocTypes.StringLiteral;
|
||||
let typeNameColor = 'inherit';
|
||||
let typeName: string|React.ReactNode;
|
||||
let typeArgs: React.ReactNode[] = [];
|
||||
|
||||
@@ -9,8 +9,6 @@ import {MethodSignature} from 'ts/pages/documentation/method_signature';
|
||||
import {Type} from 'ts/pages/documentation/type';
|
||||
import {AnchorTitle} from 'ts/pages/shared/anchor_title';
|
||||
import {CustomType, CustomTypeChild, HeaderSizes, KindString, TypeDocTypes} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {typeDocUtils} from 'ts/utils/typedoc_utils';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
const KEYWORD_COLOR = '#a81ca6';
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import * as _ from 'lodash';
|
||||
import RaisedButton from 'material-ui/RaisedButton';
|
||||
import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import * as DocumentTitle from 'react-document-title';
|
||||
import {Link} from 'react-router-dom';
|
||||
import {Footer} from 'ts/components/footer';
|
||||
import {TopBar} from 'ts/components/top_bar';
|
||||
import {Question} from 'ts/pages/faq/question';
|
||||
|
||||
@@ -6,8 +6,7 @@ import DocumentTitle = require('react-document-title');
|
||||
import {Link} from 'react-router-dom';
|
||||
import {Footer} from 'ts/components/footer';
|
||||
import {TopBar} from 'ts/components/top_bar';
|
||||
import {ScreenWidths, Styles, WebsitePaths} from 'ts/types';
|
||||
import {configs} from 'ts/utils/configs';
|
||||
import {ScreenWidths, WebsitePaths} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
@@ -269,7 +268,7 @@ export class Landing extends React.Component<LandingProps, LandingState> {
|
||||
const isSmallScreen = this.state.screenWidth === ScreenWidths.SM;
|
||||
const isMediumScreen = this.state.screenWidth === ScreenWidths.MD;
|
||||
const projectList = _.map(projects, (project: Project, i: number) => {
|
||||
const colWidth = isSmallScreen ? 3 : isMediumScreen ? 4 : 2 - (i % 2);
|
||||
const colWidth = isSmallScreen ? 3 : (isMediumScreen ? 4 : 2 - (i % 2));
|
||||
return (
|
||||
<div
|
||||
key={`project-${project.logoFileName}`}
|
||||
@@ -470,11 +469,6 @@ export class Landing extends React.Component<LandingProps, LandingState> {
|
||||
}
|
||||
private renderBuildingBlocksSection() {
|
||||
const isSmallScreen = this.state.screenWidth === ScreenWidths.SM;
|
||||
const underlineStyle: React.CSSProperties = {
|
||||
height: isSmallScreen ? 18 : 23,
|
||||
lineHeight: 'none',
|
||||
borderBottom: '2px solid #979797',
|
||||
};
|
||||
const descriptionStyle: React.CSSProperties = {
|
||||
fontFamily: 'Roboto Mono',
|
||||
lineHeight: isSmallScreen ? 1.5 : 2,
|
||||
@@ -606,21 +600,6 @@ export class Landing extends React.Component<LandingProps, LandingState> {
|
||||
});
|
||||
return assets;
|
||||
}
|
||||
private renderLink(label: string, path: string, color: string, style?: React.CSSProperties) {
|
||||
return (
|
||||
<div
|
||||
style={{borderBottom: `1px solid ${color}`, paddingBottom: 1, height: 20, lineHeight: 1.7, ...style}}
|
||||
>
|
||||
<Link
|
||||
to={path}
|
||||
className="text-decoration-none"
|
||||
style={{color, fontFamily: 'Roboto Mono'}}
|
||||
>
|
||||
{label}
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
private renderInfoBoxes() {
|
||||
const isSmallScreen = this.state.screenWidth === ScreenWidths.SM;
|
||||
const boxStyle: React.CSSProperties = {
|
||||
@@ -676,7 +655,6 @@ export class Landing extends React.Component<LandingProps, LandingState> {
|
||||
}
|
||||
private renderUseCases() {
|
||||
const isSmallScreen = this.state.screenWidth === ScreenWidths.SM;
|
||||
const isMediumScreen = this.state.screenWidth === ScreenWidths.MD;
|
||||
|
||||
const useCases: UseCase[] = [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import {Link} from 'react-router-dom';
|
||||
import {Footer} from 'ts/components/footer';
|
||||
import {TopBar} from 'ts/components/top_bar';
|
||||
import {Styles} from 'ts/types';
|
||||
|
||||
@@ -4,9 +4,8 @@ import {colors} from 'material-ui/styles';
|
||||
import * as React from 'react';
|
||||
import {Link as ScrollLink} from 'react-scroll';
|
||||
import {VersionDropDown} from 'ts/pages/shared/version_drop_down';
|
||||
import {Docs, MenuSubsectionsBySection, Styles} from 'ts/types';
|
||||
import {MenuSubsectionsBySection, Styles} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {typeDocUtils} from 'ts/utils/typedoc_utils';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
interface NestedSidebarMenuProps {
|
||||
|
||||
@@ -2,8 +2,6 @@ import * as _ from 'lodash';
|
||||
import DropDownMenu from 'material-ui/DropDownMenu';
|
||||
import MenuItem from 'material-ui/MenuItem';
|
||||
import * as React from 'react';
|
||||
import {Docs} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
|
||||
interface VersionDropDownProps {
|
||||
selectedVersion: string;
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
AssetToken,
|
||||
BlockchainErrs,
|
||||
Direction,
|
||||
Fill,
|
||||
Order,
|
||||
ProviderType,
|
||||
ScreenWidths,
|
||||
|
||||
@@ -2,7 +2,6 @@ import BigNumber from 'bignumber.js';
|
||||
import {
|
||||
ContractAddresses,
|
||||
Docs,
|
||||
ExchangeContractErrs,
|
||||
Networks,
|
||||
PublicNodeUrlsByNetworkId,
|
||||
WebsitePaths,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import findVersions = require('find-versions');
|
||||
import * as _ from 'lodash';
|
||||
import {DoxityDocObj, S3FileObject, TypeDocNode, VersionToFileName} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
import convert = require('xml-js');
|
||||
|
||||
|
||||
@@ -5,21 +5,17 @@ import {
|
||||
CustomTypeChild,
|
||||
DocAgnosticFormat,
|
||||
DocSection,
|
||||
DocsMenu,
|
||||
IndexSignature,
|
||||
KindString,
|
||||
MenuSubsectionsBySection,
|
||||
Parameter,
|
||||
Property,
|
||||
SectionsMap,
|
||||
Type,
|
||||
TypeDocNode,
|
||||
TypeDocType,
|
||||
TypeDocTypes,
|
||||
TypeParameter,
|
||||
TypescriptMethod,
|
||||
} from 'ts/types';
|
||||
import {constants} from 'ts/utils/constants';
|
||||
import {utils} from 'ts/utils/utils';
|
||||
|
||||
export const typeDocUtils = {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {ExchangeContractErrs, ZeroExError} from '0x.js';
|
||||
import BigNumber from 'bignumber.js';
|
||||
import deepEqual = require('deep-equal');
|
||||
import ethUtil = require('ethereumjs-util');
|
||||
import isMobile = require('is-mobile');
|
||||
import * as _ from 'lodash';
|
||||
import * as moment from 'moment';
|
||||
@@ -9,7 +8,6 @@ import {
|
||||
EtherscanLinkSuffixes,
|
||||
Networks,
|
||||
Order,
|
||||
OrderParty,
|
||||
ScreenWidths,
|
||||
Side,
|
||||
SideToAssetToken,
|
||||
@@ -110,9 +108,9 @@ export const utils = {
|
||||
},
|
||||
getColSize(items: number) {
|
||||
const bassCssGridSize = 12; // Source: http://basscss.com/#basscss-grid
|
||||
const colSize = 12 / items;
|
||||
const colSize = bassCssGridSize / items;
|
||||
if (!_.isInteger(colSize)) {
|
||||
throw new Error('Number of cols must be divisible by 12');
|
||||
throw new Error(`Number of cols must be divisible by ${bassCssGridSize}`);
|
||||
}
|
||||
return colSize;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user