Skip to content
Permalink
Browse files

Merge branch 'develop'

  • Loading branch information
tyler17 committed Nov 28, 2019
2 parents fddcab1 + 1e294c4 commit 3de52b81abc786f0d40d4967b93d78340fadf88a
@@ -1,4 +1,4 @@
import React, { useCallback } from 'react';
import React, { useCallback, useMemo } from 'react';
import useMaker from '../hooks/useMaker';
import IconButton from '../components/IconButton';
import { Grid } from '@makerdao/ui-components-core';
@@ -73,11 +73,11 @@ function WalletManager({ providerName }) {
>
{lang.providers.trezor}
</IconButton>
<TrezorModal
{useMemo(() => <TrezorModal
show={showTrezor}
onClose={() => setShowTrezor(false)}
onAccountChosen={onAccountChosen}
/>
/>, [onAccountChosen, showTrezor])}
</BrowserView>

<BrowserView>
@@ -93,11 +93,11 @@ function WalletManager({ providerName }) {
>
{lang.providers.ledger_nano}
</IconButton>
<LedgerModal
{useMemo(() => <LedgerModal
show={showLedger}
onClose={() => setShowLedger(false)}
onAccountChosen={onAccountChosen}
/>
/>, [onAccountChosen, showLedger])}
</BrowserView>
<BrowserView>
<IconButton
@@ -23,6 +23,7 @@ export default ({
const { maker, account } = useMaker();
const [hasReadTOS, setHasReadTOS] = useState(false);
const [daiApprovePending, setDaiApprovePending] = useState(false);
const [downgradeInitiated, setDowngradeInitiated] = useState(false);
const [proxyDetails, setProxyDetails] = useState({});
const [{ daiAmountToMigrate }, dispatch] = useStore();
const migrationContractAddress = maker
@@ -50,6 +51,7 @@ export default ({

const convertDai = async () => {
try {
setDowngradeInitiated(true);
const mig = await maker.service('migration').getMigration('dai-to-sai');
const migrationTxObject = mig.execute(daiAmountToMigrate);
maker.service('transactionManager').listen(migrationTxObject, {
@@ -183,7 +185,7 @@ export default ({
Back
</Button>
<Button
disabled={!hasReadTOS || !proxyDetails.hasDaiAllowance}
disabled={!hasReadTOS || !proxyDetails.hasDaiAllowance || downgradeInitiated}
onClick={convertDai}
>
Continue
@@ -82,6 +82,7 @@ const PayAndMigrate = ({
const [proxyDetails, setProxyDetails] = useState({});
const [mkrBalance, setMkrBalance] = useState(false);
const [saiNeededInMarket, setSaiNeededInMarket] = useState(false);
const [migrateInitiated, setMigrateInitiated] = useState(false);
const [, dispatch] = useStore();
const { maker, account } = useMaker();
const { govFeeMKRExact } = selectedCDP;
@@ -116,6 +117,7 @@ const PayAndMigrate = ({

const migrateCdpPayWithMkr = async () => {
try {
setMigrateInitiated(true);
const mig = maker
.service('migration')
.getMigration('single-to-multi-cdp');
@@ -141,6 +143,7 @@ const PayAndMigrate = ({

const migrateCdpPayWithDebt = async () => {
try {
setMigrateInitiated(true);
const mig = maker
.service('migration')
.getMigration('single-to-multi-cdp');
@@ -389,6 +392,7 @@ const PayAndMigrate = ({
<Button
justifySelf="center"
disabled={
migrateInitiated ||
!hasReadTOS ||
(selectedTab === TAB_PAY_WITH_MKR &&
!proxyDetails.hasMkrAllowance) ||
@@ -25,6 +25,7 @@ export default ({
const [saiApprovePending, setSaiApprovePending] = useState(false);
const [proxyDetails, setProxyDetails] = useState({});
const [{ saiAmountToMigrate }, dispatch] = useStore();
const [upgradeInitiated, setUpgradeInitiated] = useState(false);
const migrationContractAddress = maker
.service('smartContract')
.getContract('MIGRATION').address;
@@ -48,6 +49,7 @@ export default ({

const upgradeSai = async () => {
try {
setUpgradeInitiated(true);
const mig = await maker.service('migration').getMigration('sai-to-dai');
const migrationTxObject = mig.execute(saiAmountToMigrate);
maker.service('transactionManager').listen(migrationTxObject, {
@@ -181,7 +183,7 @@ export default ({
Back
</Button>
<Button
disabled={!hasReadTOS || !proxyDetails.hasSaiAllowance}
disabled={!hasReadTOS || !proxyDetails.hasSaiAllowance || upgradeInitiated}
onClick={upgradeSai}
>
Continue
@@ -32,7 +32,7 @@ const SimpleBg = styled(Bg)`
align-items: center;
`;

export const BasicModal = ({ show, onClose, modalProps, children }) => {
const BasicModal = ({ show, onClose, modalProps, children }) => {
const [fadeStart, fadeEnd] = animations.fade;
const [fadeUpStart, fadeUpEnd] = animations.fadeUp;

@@ -85,9 +85,4 @@ export const BasicModal = ({ show, onClose, modalProps, children }) => {
);
};

const templates = {
basic: BasicModal,
default: BasicModal
};

export default templates;
export default BasicModal;
@@ -2,7 +2,7 @@ import { useRef, useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import LedgerType from './LedgerType';
import HardwareAccountSelect from './HardwareAccountSelect';
import { BasicModal } from './templates';
import BasicModal from './BasicModal';
import { AccountTypes } from '../../utils/constants';

const TREZOR_PATH = "44'/60'/0'/0/0";

This file was deleted.

This file was deleted.

@@ -5,7 +5,6 @@ import { ThemeProvider, createGlobalStyle } from 'styled-components';
import '@makerdao/ui-components-core/dist/styles/global.css';
import MakerProvider from '../providers/MakerProvider';
import StoreProvider from '../providers/StoreProvider';
import WalletProvider from '../providers/WalletProvider';
import theme, { getColor } from '../utils/theme';
import DevFooter from '../components/DevFooter';
import Toast from '../components/Toast';
@@ -40,11 +39,9 @@ export default class MyApp extends App {
<ThemeProvider theme={theme}>
<MakerProvider network={network}>
<StoreProvider>
<WalletProvider>
<Component {...pageProps} />
<Toast />
<DevFooter />
</WalletProvider>
<Component {...pageProps} />
<Toast />
<DevFooter />
</StoreProvider>
</MakerProvider>
</ThemeProvider>

This file was deleted.

@@ -3,7 +3,6 @@ import { render as renderBase } from '@testing-library/react';
import { ThemeProvider } from 'styled-components';
import MakerProvider from '../../providers/MakerProvider';
import StoreProvider from '../../providers/StoreProvider';
import WalletProvider from '../../providers/WalletProvider';
import useStore from '../../hooks/useStore';
import theme from '../../utils/theme';

@@ -17,9 +16,7 @@ export default async function render(children, { initialState } = {}) {
<ThemeProvider theme={theme}>
<MakerProvider>
<StoreProvider initialState={initialState}>
<WalletProvider>
<StoreAccess callback={callback}>{children}</StoreAccess>
</WalletProvider>
<StoreAccess callback={callback}>{children}</StoreAccess>
</StoreProvider>
</MakerProvider>
</ThemeProvider>

0 comments on commit 3de52b8

Please sign in to comment.
You can’t perform that action at this time.