Cleanup unused parts
This commit is contained in:
committed by
Jacob Evans
parent
9caa5feff5
commit
e5ea65da82
@@ -1,17 +1,14 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import DocumentTitle from 'react-document-title';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { constants as sharedConstants } from '@0x/react-shared';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { colors } from 'ts/style/colors';
|
||||
import { constants } from 'ts/utils/constants';
|
||||
|
||||
import { AddressTableRow } from 'ts/pages/governance/address_table_row';
|
||||
|
||||
import { ChangeEvent } from 'react';
|
||||
import { AddressTableRow } from 'ts/pages/governance/address_table_row';
|
||||
|
||||
interface AddressTableProps {
|
||||
networkId: number;
|
||||
|
@@ -244,7 +244,7 @@ export class ConnectForm extends React.Component<Props, State> {
|
||||
|
||||
return amount;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
// console.log(error);
|
||||
return new BigNumber(0);
|
||||
}
|
||||
}
|
||||
@@ -337,7 +337,7 @@ export class ConnectForm extends React.Component<Props, State> {
|
||||
addressBalances.push(balanceInZrx);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
// console.log(err);
|
||||
// logUtils.log(`Ledger error: ${JSON.stringify(err)}`);
|
||||
this.setState({
|
||||
errors: {
|
||||
@@ -467,7 +467,7 @@ export class ConnectForm extends React.Component<Props, State> {
|
||||
try {
|
||||
await injectedProviderIfExists.enable();
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
// console.log(err);
|
||||
// errorReporter.report(err);
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as React from 'react';
|
||||
import DocumentTitle from 'react-document-title';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { colors } from 'ts/style/colors';
|
||||
|
@@ -8,8 +8,6 @@ import { Button } from 'ts/components/button';
|
||||
import { Input } from 'ts/components/modals/input';
|
||||
import { Paragraph } from 'ts/components/text';
|
||||
|
||||
import { ChangeEvent } from 'react';
|
||||
|
||||
interface InputProps {
|
||||
path: string;
|
||||
onChangePath?: (selectedPath: string) => void;
|
||||
|
@@ -5,11 +5,10 @@ import styled from 'styled-components';
|
||||
|
||||
import { Banner } from 'ts/components/banner';
|
||||
import { Button } from 'ts/components/button';
|
||||
import { Column, FlexWrap, Section, WrapSticky } from 'ts/components/newLayout';
|
||||
import { Column, FlexWrap, Section } from 'ts/components/newLayout';
|
||||
import { SiteWrap } from 'ts/components/siteWrap';
|
||||
import { Heading, Paragraph } from 'ts/components/text';
|
||||
import { ConnectedWalletMark } from 'ts/pages/governance/connected_wallet_mark';
|
||||
import { Countdown, VoteDeadline } from 'ts/pages/governance/countdown';
|
||||
import { Countdown } from 'ts/pages/governance/countdown';
|
||||
import { RatingBar } from 'ts/pages/governance/rating_bar';
|
||||
import { VoteStats } from 'ts/pages/governance/vote_stats';
|
||||
|
||||
@@ -18,7 +17,6 @@ import { ModalVote } from 'ts/pages/governance/modal_vote';
|
||||
import { colors } from 'ts/style/colors';
|
||||
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
|
||||
interface LabelInterface {
|
||||
[key: number]: string;
|
||||
@@ -143,7 +141,7 @@ export class Governance extends React.Component {
|
||||
);
|
||||
return (
|
||||
<SiteWrap theme="dark">
|
||||
<DocumentTitle title="Features & Benefits - 0x" />
|
||||
<DocumentTitle title="Governance Vote - 0x" />
|
||||
<Section maxWidth="1170px" isFlex={true}>
|
||||
<Column width="55%" maxWidth="560px">
|
||||
<Countdown deadline={proposalData.votingDeadline} />
|
||||
@@ -300,10 +298,6 @@ export class Governance extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
interface SectionProps {
|
||||
isNotRelative?: boolean;
|
||||
}
|
||||
|
||||
const SectionWrap = styled.div`
|
||||
& + & {
|
||||
padding-top: 50px;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import * as _ from 'lodash';
|
||||
import * as moment from 'moment';
|
||||
import * as React from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
@@ -9,64 +8,27 @@ import { DialogContent, DialogOverlay } from '@reach/dialog';
|
||||
import '@reach/dialog/styles.css';
|
||||
|
||||
// import { LedgerSubprovider, Web3ProviderEngine } from '@0x/subproviders';
|
||||
import { getContractAddressesForNetworkOrThrow } from '@0x/contract-addresses';
|
||||
import { ContractWrappers } from '@0x/contract-wrappers';
|
||||
import { BigNumber, signTypedDataUtils } from '@0x/utils';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
|
||||
import { Button } from 'ts/components/button';
|
||||
import { Icon } from 'ts/components/icon';
|
||||
import { Input, InputWidth } from 'ts/components/modals/input';
|
||||
import { Heading, Paragraph } from 'ts/components/text';
|
||||
import { GlobalStyle } from 'ts/constants/globalStyle';
|
||||
import { utils } from 'ts/utils/utils';
|
||||
import { FormEvent } from 'react';
|
||||
|
||||
import { ConnectForm, WalletConnectedProps } from 'ts/pages/governance/connect_form';
|
||||
import { VoteForm } from 'ts/pages/governance/vote_form';
|
||||
|
||||
import { signatureUtils } from '0x.js';
|
||||
import * as ethUtil from 'ethereumjs-util';
|
||||
|
||||
import { ECSignature } from '@0x/types';
|
||||
|
||||
import {
|
||||
ledgerEthereumBrowserClientFactoryAsync,
|
||||
LedgerSubprovider,
|
||||
MetamaskSubprovider,
|
||||
RedundantSubprovider,
|
||||
RPCSubprovider,
|
||||
SignerSubprovider,
|
||||
Web3ProviderEngine,
|
||||
} from '@0x/subproviders';
|
||||
import { BlockParam, LogWithDecodedArgs, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
|
||||
import { Provider } from 'ethereum-types';
|
||||
import {
|
||||
BlockchainCallErrs,
|
||||
BlockchainErrs,
|
||||
ContractInstance,
|
||||
Fill,
|
||||
InjectedProvider,
|
||||
InjectedProviderObservable,
|
||||
InjectedProviderUpdate,
|
||||
JSONRPCPayload,
|
||||
Providers,
|
||||
ProviderType,
|
||||
Side,
|
||||
SideToAssetToken,
|
||||
Token,
|
||||
TokenByAddress,
|
||||
} from 'ts/types';
|
||||
import { configs } from 'ts/utils/configs';
|
||||
import { constants } from 'ts/utils/constants';
|
||||
import FilterSubprovider from 'web3-provider-engine/subproviders/filters';
|
||||
|
||||
const providerToName: { [provider: string]: string } = {
|
||||
[Providers.Metamask]: constants.PROVIDER_NAME_METAMASK,
|
||||
[Providers.Parity]: constants.PROVIDER_NAME_PARITY_SIGNER,
|
||||
[Providers.Mist]: constants.PROVIDER_NAME_MIST,
|
||||
[Providers.CoinbaseWallet]: constants.PROVIDER_NAME_COINBASE_WALLET,
|
||||
[Providers.Cipher]: constants.PROVIDER_NAME_CIPHER,
|
||||
};
|
||||
|
||||
interface Props {
|
||||
theme?: GlobalStyle;
|
||||
@@ -165,7 +127,7 @@ export class ModalVote extends React.Component<Props> {
|
||||
}
|
||||
public render(): React.ReactNode {
|
||||
const { isOpen, onDismiss } = this.props;
|
||||
const { isSuccessful, errors, votePreference, selectedAddress, currentBalance } = this.state;
|
||||
const { isSuccessful, errors, selectedAddress, currentBalance } = this.state;
|
||||
const formattedBalance = Web3Wrapper.toUnitAmount(currentBalance, constants.DECIMAL_PLACES_ETH).toFixed(configs.AMOUNT_DISPLAY_PRECSION);
|
||||
return (
|
||||
<>
|
||||
@@ -295,37 +257,8 @@ export class ModalVote extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle errors: {"errors":[{"location":"body","param":"name","msg":"Invalid value"},{"location":"body","param":"email","msg":"Invalid value"}]}
|
||||
|
||||
const InputRow = styled.div`
|
||||
width: 100%;
|
||||
flex: 0 0 auto;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
`;
|
||||
|
||||
const ButtonRow = styled(InputRow)`
|
||||
@media (max-width: 768px) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
button:nth-child(1) {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
button:nth-child(2) {
|
||||
order: 1;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const ButtonClose = styled.button.attrs({})`
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
|
@@ -3,7 +3,7 @@ import * as moment from 'moment';
|
||||
import * as React from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { ChangeEvent } from 'react';
|
||||
import { ChangeEvent, FormEvent } from 'react';
|
||||
|
||||
import { colors } from 'ts/style/colors';
|
||||
|
||||
@@ -17,13 +17,8 @@ import { BigNumber, signTypedDataUtils } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
|
||||
import { Button } from 'ts/components/button';
|
||||
import { Icon } from 'ts/components/icon';
|
||||
import { Input, InputWidth } from 'ts/components/modals/input';
|
||||
import { Input } from 'ts/components/modals/input';
|
||||
import { Heading, Paragraph } from 'ts/components/text';
|
||||
import { GlobalStyle } from 'ts/constants/globalStyle';
|
||||
import { utils } from 'ts/utils/utils';
|
||||
import { FormEvent } from 'react';
|
||||
|
||||
import { PreferenceSelecter } from 'ts/pages/governance/preference_selecter';
|
||||
|
||||
import { signatureUtils } from '0x.js';
|
||||
@@ -32,34 +27,15 @@ import * as ethUtil from 'ethereumjs-util';
|
||||
import { ECSignature } from '@0x/types';
|
||||
|
||||
import {
|
||||
ledgerEthereumBrowserClientFactoryAsync,
|
||||
LedgerSubprovider,
|
||||
MetamaskSubprovider,
|
||||
RedundantSubprovider,
|
||||
RPCSubprovider,
|
||||
SignerSubprovider,
|
||||
Web3ProviderEngine,
|
||||
} from '@0x/subproviders';
|
||||
import { BlockParam, LogWithDecodedArgs, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
|
||||
import { Provider } from 'ethereum-types';
|
||||
import {
|
||||
BlockchainCallErrs,
|
||||
BlockchainErrs,
|
||||
ContractInstance,
|
||||
Fill,
|
||||
InjectedProvider,
|
||||
InjectedProviderObservable,
|
||||
InjectedProviderUpdate,
|
||||
JSONRPCPayload,
|
||||
Providers,
|
||||
ProviderType,
|
||||
Side,
|
||||
SideToAssetToken,
|
||||
Token,
|
||||
TokenByAddress,
|
||||
} from 'ts/types';
|
||||
import { configs } from 'ts/utils/configs';
|
||||
import { constants } from 'ts/utils/constants';
|
||||
import FilterSubprovider from 'web3-provider-engine/subproviders/filters';
|
||||
|
||||
const providerToName: { [provider: string]: string } = {
|
||||
[Providers.Metamask]: constants.PROVIDER_NAME_METAMASK,
|
||||
@@ -69,11 +45,6 @@ const providerToName: { [provider: string]: string } = {
|
||||
[Providers.Cipher]: constants.PROVIDER_NAME_CIPHER,
|
||||
};
|
||||
|
||||
export enum ModalContactType {
|
||||
General = 'GENERAL',
|
||||
MarketMaker = 'MARKET_MAKER',
|
||||
}
|
||||
|
||||
export enum VoteValue {
|
||||
Yes = 'Yes',
|
||||
No = 'No',
|
||||
@@ -365,14 +336,6 @@ const ButtonRow = styled(InputRow)`
|
||||
}
|
||||
`;
|
||||
|
||||
const ButtonFull = styled(Button)`
|
||||
width: 100%;
|
||||
`;
|
||||
|
||||
const ButtonHalf = styled(Button)`
|
||||
width: calc(50% - 15px);
|
||||
`;
|
||||
|
||||
const ButtonDisabled = styled(Button)<{ isDisabled?: boolean; disabled?: boolean }>`
|
||||
background-color: ${props => props.disabled && '#898990'};
|
||||
opacity: ${props => props.disabled && '0.4'};
|
||||
@@ -387,23 +350,3 @@ const Form = styled.form<FormProps>`
|
||||
const PreferenceWrapper = styled.div`
|
||||
margin-bottom: 30px;
|
||||
`;
|
||||
|
||||
const Confirmation = styled.div<FormProps>`
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
|
||||
transition-delay: 0.4s;
|
||||
padding: 60px 60px;
|
||||
transform: translateY(-50%);
|
||||
opacity: ${props => (props.isSuccessful ? `1` : `0`)};
|
||||
visibility: ${props => (props.isSuccessful ? 'visible' : `hidden`)};
|
||||
|
||||
p {
|
||||
max-width: 492px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
`;
|
||||
|
Reference in New Issue
Block a user