Ui 2 shared package (redux, mobx, utils) (#5579)
* Create @parity/shared * Move ~/util to shared/util * Move ~/contracts to shared/contracts * Move ~/config to shared/config * Move ~/environment to shared/environment * Updated paths * Move ~/mobx to shared/mobx * Move ~/redux to shared/redux * Add shared to test babel compile
This commit is contained in:
@@ -18,7 +18,7 @@ import BigNumber from 'bignumber.js';
|
||||
import sinon from 'sinon';
|
||||
import localStore from 'store';
|
||||
|
||||
import Contracts from '~/contracts';
|
||||
import Contracts from '@parity/shared/contracts';
|
||||
|
||||
import Store, { LS_KEY_DISPLAY } from './dappsStore';
|
||||
|
||||
|
||||
@@ -18,12 +18,8 @@ import EventEmitter from 'eventemitter3';
|
||||
import { action, computed, observable, transaction } from 'mobx';
|
||||
import store from 'store';
|
||||
|
||||
import Contracts from '~/contracts';
|
||||
import {
|
||||
fetchBuiltinApps, fetchLocalApps,
|
||||
fetchRegistryAppIds, fetchRegistryApp,
|
||||
subscribeToChanges
|
||||
} from '~/util/dapps';
|
||||
import Contracts from '@parity/shared/contracts';
|
||||
import { fetchBuiltinApps, fetchLocalApps, fetchRegistryAppIds, fetchRegistryApp, subscribeToChanges } from '@parity/shared/util/dapps';
|
||||
|
||||
const LS_KEY_DISPLAY = 'displayApps';
|
||||
const LS_KEY_EXTERNAL_ACCEPT = 'acceptExternal';
|
||||
|
||||
@@ -21,7 +21,7 @@ import { action, computed, observable } from 'mobx';
|
||||
import store from 'store';
|
||||
import browser from 'useragent.js/lib/browser';
|
||||
|
||||
import { DOMAIN } from '~/util/constants';
|
||||
import { DOMAIN } from '@parity/shared/util/constants';
|
||||
|
||||
const A_DAY = 24 * 60 * 60 * 1000;
|
||||
const NEXT_DISPLAY = '_parity::extensionWarning::nextDisplay';
|
||||
|
||||
@@ -21,9 +21,9 @@ import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
|
||||
import { createIdentityImg } from '@parity/api/util/identity';
|
||||
import { newError } from '@parity/shared/redux/actions';
|
||||
|
||||
import ParityLogo from '~/../assets/images/parity-logo-black-no-text.svg';
|
||||
import { newError } from '~/redux/actions';
|
||||
import { Button, Portal } from '~/ui';
|
||||
import { CheckIcon, DoneIcon, NextIcon, PrintIcon } from '~/ui/Icons';
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ import ReactDOM from 'react-dom';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
|
||||
import { hideRequest } from '~/redux/providers/requestsActions';
|
||||
import { hideRequest } from '@parity/shared/redux/providers/requestsActions';
|
||||
|
||||
import { MethodDecoding, IdentityIcon, Progress, ScrollableText, ShortenedHash } from '~/ui';
|
||||
|
||||
import styles from './requests.css';
|
||||
|
||||
@@ -20,10 +20,12 @@ import { FormattedMessage } from 'react-intl';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
|
||||
import Store from '../store';
|
||||
import * as RequestsActions from '~/redux/providers/signerActions';
|
||||
import * as RequestsActions from '@parity/shared/redux/providers/signerActions';
|
||||
|
||||
import { Container } from '~/ui';
|
||||
|
||||
import Store from '../store';
|
||||
|
||||
import RequestPending from '../components/RequestPending';
|
||||
|
||||
import styles from './embedded.css';
|
||||
|
||||
@@ -19,7 +19,7 @@ import React, { Component, PropTypes } from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import HardwareStore from '~/mobx/hardwareStore';
|
||||
import HardwareStore from '@parity/shared/mobx/hardwareStore';
|
||||
|
||||
import Account from '../Account';
|
||||
import TransactionPendingForm from '../TransactionPendingForm';
|
||||
|
||||
@@ -19,7 +19,8 @@ import React, { Component, PropTypes } from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import HardwareStore from '~/mobx/hardwareStore';
|
||||
import HardwareStore from '@parity/shared/mobx/hardwareStore';
|
||||
|
||||
import { Button, GasPriceEditor } from '~/ui';
|
||||
|
||||
import TransactionMainDetails from '../TransactionMainDetails';
|
||||
|
||||
@@ -18,9 +18,9 @@ import React, { PropTypes } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
|
||||
import { Snackbar as SnackbarUI } from '~/ui';
|
||||
import { closeSnackbar } from '@parity/shared/redux/providers/snackbarActions';
|
||||
|
||||
import { closeSnackbar } from '~/redux/providers/snackbarActions';
|
||||
import { Snackbar as SnackbarUI } from '~/ui';
|
||||
|
||||
function Snackbar ({ closeSnackbar, cooldown = 3500, message, open = false }) {
|
||||
return (
|
||||
|
||||
@@ -25,16 +25,16 @@ import ReactDOM from 'react-dom';
|
||||
|
||||
import injectTapEventPlugin from 'react-tap-event-plugin';
|
||||
|
||||
import SecureApi from '~/secureApi';
|
||||
import ContractInstances from '~/contracts';
|
||||
import ContractInstances from '@parity/shared/contracts';
|
||||
import { initStore } from '@parity/shared/redux';
|
||||
import { patchApi } from '@parity/shared/util/tx';
|
||||
|
||||
import SecureApi from '~/secureApi';
|
||||
|
||||
import { initStore } from '~/redux';
|
||||
import ContextProvider from '~/ui/ContextProvider';
|
||||
import muiTheme from '~/ui/Theme';
|
||||
|
||||
import { patchApi } from '~/util/tx';
|
||||
|
||||
import '~/environment';
|
||||
import '@parity/shared/environment';
|
||||
|
||||
import '~/../assets/fonts/Roboto/font.css';
|
||||
import '~/../assets/fonts/RobotoMono/font.css';
|
||||
|
||||
@@ -27,20 +27,24 @@ import injectTapEventPlugin from 'react-tap-event-plugin';
|
||||
import { IndexRoute, Redirect, Route, Router, hashHistory } from 'react-router';
|
||||
import qs from 'querystring';
|
||||
|
||||
import SecureApi from '~/secureApi';
|
||||
import ContractInstances from '~/contracts';
|
||||
import builtinDapps from '@parity/shared/config/dappsBuiltin.json';
|
||||
import viewsDapps from '@parity/shared/config/dappsViews.json';
|
||||
import ContractInstances from '@parity/shared/contracts';
|
||||
import HistoryStore from '@parity/shared/mobx/historyStore';
|
||||
import { initStore } from '@parity/shared/redux';
|
||||
import { patchApi } from '@parity/shared/util/tx';
|
||||
|
||||
import '@parity/shared/environment';
|
||||
|
||||
import SecureApi from '~/secureApi';
|
||||
|
||||
import { initStore } from '~/redux';
|
||||
import ContextProvider from '~/ui/ContextProvider';
|
||||
import muiTheme from '~/ui/Theme';
|
||||
import { patchApi } from '~/util/tx';
|
||||
|
||||
import Application from './Application';
|
||||
import Dapp from './Dapp';
|
||||
import Dapps from './Dapps';
|
||||
|
||||
import '~/environment';
|
||||
|
||||
injectTapEventPlugin();
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
@@ -69,10 +73,6 @@ const store = initStore(api, hashHistory);
|
||||
|
||||
window.secureApi = api;
|
||||
|
||||
import HistoryStore from '~/mobx/historyStore';
|
||||
import builtinDapps from '~/config/dappsBuiltin.json';
|
||||
import viewsDapps from '~/config/dappsViews.json';
|
||||
|
||||
const dapps = [].concat(viewsDapps, builtinDapps);
|
||||
|
||||
const dappsHistory = HistoryStore.get('dapps');
|
||||
|
||||
Reference in New Issue
Block a user