aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-04-04 02:58:18 +0800
committerGitHub <noreply@github.com>2018-04-04 02:58:18 +0800
commit674e56cea69fe96ddd0071d3c4c5b5ea8ae299bf (patch)
tree19ddd0c0312eed054595c0d3431ecddead18e857 /packages/website/ts
parent4a9752d7cda05f616d2709e34f4687da813d3090 (diff)
parent61809130a6659335c7550cf35c55e20b3e579a6f (diff)
downloaddexon-sol-tools-674e56cea69fe96ddd0071d3c4c5b5ea8ae299bf.tar
dexon-sol-tools-674e56cea69fe96ddd0071d3c4c5b5ea8ae299bf.tar.gz
dexon-sol-tools-674e56cea69fe96ddd0071d3c4c5b5ea8ae299bf.tar.bz2
dexon-sol-tools-674e56cea69fe96ddd0071d3c4c5b5ea8ae299bf.tar.lz
dexon-sol-tools-674e56cea69fe96ddd0071d3c4c5b5ea8ae299bf.tar.xz
dexon-sol-tools-674e56cea69fe96ddd0071d3c4c5b5ea8ae299bf.tar.zst
dexon-sol-tools-674e56cea69fe96ddd0071d3c4c5b5ea8ae299bf.zip
Merge pull request #496 from 0xProject/removeUnusedDeps
Remove unused deps + Remove Dharma from website
Diffstat (limited to 'packages/website/ts')
-rw-r--r--packages/website/ts/components/token_balances.tsx69
-rw-r--r--packages/website/ts/globals.d.ts3
2 files changed, 0 insertions, 72 deletions
diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index b4a710ef4..618b5fe8f 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -8,7 +8,6 @@ import {
utils as sharedUtils,
} from '@0xproject/react-shared';
import { BigNumber, logUtils } from '@0xproject/utils';
-import DharmaLoanFrame from 'dharma-loan-frame';
import * as _ from 'lodash';
import Dialog from 'material-ui/Dialog';
import Divider from 'material-ui/Divider';
@@ -79,7 +78,6 @@ interface TokenBalancesProps {
interface TokenBalancesState {
errorType: BalanceErrs;
isBalanceSpinnerVisible: boolean;
- isDharmaDialogVisible: boolean;
isZRXSpinnerVisible: boolean;
isTokenPickerOpen: boolean;
isAddingToken: boolean;
@@ -96,7 +94,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
errorType: undefined,
isBalanceSpinnerVisible: false,
isZRXSpinnerVisible: false,
- isDharmaDialogVisible: DharmaLoanFrame.isAuthTokenPresent(),
isTokenPickerOpen: false,
isAddingToken: false,
trackedTokenStateByAddress: initialTrackedTokenStateByAddress,
@@ -168,20 +165,8 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
onTouchTap={this._onErrorDialogToggle.bind(this, false)}
/>,
];
- const dharmaDialogActions = [
- <FlatButton
- key="dharmaCloseBtn"
- label="Close"
- primary={true}
- onTouchTap={this._onDharmaDialogToggle.bind(this, false)}
- />,
- ];
const isTestNetwork = utils.isTestNetwork(this.props.networkId);
const isKovanTestNetwork = this.props.networkId === constants.NETWORK_ID_KOVAN;
- const dharmaButtonColumnStyle = {
- paddingLeft: 3,
- display: isKovanTestNetwork ? 'table-cell' : 'none',
- };
const stubColumnStyle = {
display: isTestNetwork ? 'none' : 'table-cell',
};
@@ -190,11 +175,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
allTokenRowHeight < MAX_TOKEN_TABLE_HEIGHT ? allTokenRowHeight : MAX_TOKEN_TABLE_HEIGHT;
const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm;
const tokenColSpan = isSmallScreen ? TOKEN_COL_SPAN_SM : TOKEN_COL_SPAN_LG;
- const dharmaLoanExplanation =
- 'If you need access to larger amounts of ether,<br> \
- you can request a loan from the Dharma Loan<br> \
- network. Your loan should be funded in 5<br> \
- minutes or less.';
const allowanceExplanation =
'0x smart contracts require access to your<br> \
token balances in order to execute trades.<br> \
@@ -226,12 +206,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
{isSmallScreen ? 'Faucet' : 'Request from faucet'}
</TableHeaderColumn>
)}
- {isKovanTestNetwork && (
- <TableHeaderColumn style={dharmaButtonColumnStyle}>
- {isSmallScreen ? 'Loan' : 'Request Dharma loan'}
- <HelpTooltip style={{ paddingLeft: 4 }} explanation={dharmaLoanExplanation} />
- </TableHeaderColumn>
- )}
</TableRow>
</TableHeader>
<TableBody displayRowCheckbox={false}>
@@ -258,15 +232,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
/>
</TableRowColumn>
)}
- {isKovanTestNetwork && (
- <TableRowColumn style={dharmaButtonColumnStyle}>
- <RaisedButton
- label="Request"
- style={{ width: '100%' }}
- onTouchTap={this._onDharmaDialogToggle.bind(this)}
- />
- </TableRowColumn>
- )}
</TableRow>
</TableBody>
</Table>
@@ -315,17 +280,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
>
{this._renderErrorDialogBody()}
</Dialog>
- <Dialog
- title="Request Dharma Loan"
- titleStyle={{ fontWeight: 100, backgroundColor: colors.white }}
- bodyStyle={{ backgroundColor: colors.dharmaDarkGrey }}
- actionsContainerStyle={{ backgroundColor: colors.white }}
- autoScrollBodyContent={true}
- actions={dharmaDialogActions}
- open={this.state.isDharmaDialogVisible}
- >
- {this._renderDharmaLoanFrame()}
- </Dialog>
<AssetPicker
userAddress={this.props.userAddress}
networkId={this.props.networkId}
@@ -545,24 +499,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
throw utils.spawnSwitchErr('errorType', this.state.errorType);
}
}
- private _renderDharmaLoanFrame() {
- if (sharedUtils.isUserOnMobile()) {
- return (
- <h4 style={{ textAlign: 'center' }}>
- We apologize -- Dharma loan requests are not available on mobile yet. Please try again through your
- desktop browser.
- </h4>
- );
- } else {
- return (
- <DharmaLoanFrame
- partner="0x"
- env={utils.getCurrentEnvironment()}
- screenWidth={this.props.screenWidth}
- />
- );
- }
- }
private _onErrorOccurred(errorType: BalanceErrs) {
this.setState({
errorType,
@@ -646,11 +582,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
errorType: undefined,
});
}
- private _onDharmaDialogToggle() {
- this.setState({
- isDharmaDialogVisible: !this.state.isDharmaDialogVisible,
- });
- }
private _onAddTokenClicked() {
this.setState({
isTokenPickerOpen: true,
diff --git a/packages/website/ts/globals.d.ts b/packages/website/ts/globals.d.ts
index fcf4c2434..2c2140485 100644
--- a/packages/website/ts/globals.d.ts
+++ b/packages/website/ts/globals.d.ts
@@ -1,12 +1,9 @@
declare module 'react-tooltip';
-declare module 'react-router-hash-link';
declare module 'truffle-contract';
declare module 'keccak';
declare module 'whatwg-fetch';
-declare module 'react-html5video';
declare module 'web3-provider-engine/subproviders/filters';
declare module 'thenby';
-declare module 'react-recaptcha';
declare module 'react-document-title';
declare module 'react-ga';