on master help sign in
refactor: move history to /store
4a17a28Matt Condon (shrugs)
src/bridge/Bridge.js+1−1
@@ -9,7 +9,7 @@ import { Container, Row, Col } from "./components/Base";
9import { router } from "./lib/router";
9import { router } from "./lib/router";
10import { initWeb3 } from "./lib/web3";
10import { initWeb3 } from "./lib/web3";
11import { ROUTE_NAMES } from "./lib/routeNames";
11import { ROUTE_NAMES } from "./lib/routeNames";
12−import { HistoryProvider, withHistory, useHistory } from "./lib/history";
12+import { HistoryProvider, withHistory, useHistory } from "./store/history";
13import { TxnConfirmationsProvider } from "./store/txnConfirmations";
13import { TxnConfirmationsProvider } from "./store/txnConfirmations";
14import { NETWORK_NAMES } from "./lib/network";
14import { NETWORK_NAMES } from "./lib/network";
15import {
15import {
src/bridge/components/Header.js+1−1
@@ -3,7 +3,7 @@ import { Button, Chevron } from "../components/Base";
3
3
4import { getRouteBreadcrumb } from "../lib/router";
4import { getRouteBreadcrumb } from "../lib/router";
5import { ROUTE_NAMES } from "../lib/routeNames";
5import { ROUTE_NAMES } from "../lib/routeNames";
6−import { useHistory } from "../lib/history";
6+import { useHistory } from "../store/history";
7import { isLast } from "../lib/lib";
7import { isLast } from "../lib/lib";
8
8
9function Crumbs(props) {
9function Crumbs(props) {
src/bridge/components/StatelessTransaction.js+1−1
@@ -10,7 +10,7 @@ import { Warning } from "../components/Base";
10
10
11import { BRIDGE_ERROR } from "../lib/error";
11import { BRIDGE_ERROR } from "../lib/error";
12import { ROUTE_NAMES } from "../lib/routeNames";
12import { ROUTE_NAMES } from "../lib/routeNames";
13−import { withHistory } from "../lib/history";
13+import { withHistory } from "../store/history";
14import * as tank from "../lib/tank";
14import * as tank from "../lib/tank";
15
15
16import {
16import {
src/bridge/lib/history.js → src/bridge/store/history.jsrenamed+2−2
@@ -1,8 +1,8 @@
1import React, { useContext, useState, useEffect } from "react";
1import React, { useContext, useState, useEffect } from "react";
2import { last, includes } from "lodash";
2import { last, includes } from "lodash";
3
3
4−import { BRIDGE_ERROR } from "./error";
4+import { BRIDGE_ERROR } from "../lib/error";
5−import { ROUTE_NAMES } from "./routeNames";
5+import { ROUTE_NAMES } from "../lib/routeNames";
6
6
7export const HistoryContext = React.createContext(null);
7export const HistoryContext = React.createContext(null);
8
8
src/bridge/views/InviteTicket.js+1−1
@@ -15,7 +15,7 @@ import * as need from "../lib/need";
15
15
16import { randomPatq } from "../lib/lib";
16import { randomPatq } from "../lib/lib";
17import { ROUTE_NAMES } from "../lib/routeNames";
17import { ROUTE_NAMES } from "../lib/routeNames";
18−import { withHistory } from "../lib/history";
18+import { withHistory } from "../store/history";
19import {
19import {
20 DEFAULT_HD_PATH,
20 DEFAULT_HD_PATH,
21 ownershipWalletFromTicket,
21 ownershipWalletFromTicket,
src/bridge/views/Keystore.js+1−1
@@ -8,7 +8,7 @@ import { Row, Col, H1, H3, Warning } from "../components/Base";
8
8
9import { BRIDGE_ERROR } from "../lib/error";
9import { BRIDGE_ERROR } from "../lib/error";
10import { ROUTE_NAMES } from "../lib/routeNames";
10import { ROUTE_NAMES } from "../lib/routeNames";
11−import { withHistory } from "../lib/history";
11+import { withHistory } from "../store/history";
12import { EthereumWallet } from "../lib/wallet";
12import { EthereumWallet } from "../lib/wallet";
13
13
14class Keystore extends React.Component {
14class Keystore extends React.Component {
src/bridge/views/Landing.js+1−1
@@ -4,7 +4,7 @@ import { Row, Col } from "../components/Base";
4import { H1, P } from "../components/Base";
4import { H1, P } from "../components/Base";
5
5
6import { ROUTE_NAMES } from "../lib/routeNames";
6import { ROUTE_NAMES } from "../lib/routeNames";
7−import { useHistory } from "../lib/history";
7+import { useHistory } from "../store/history";
8
8
9function Landing(props) {
9function Landing(props) {
10 const history = useHistory();
10 const history = useHistory();
src/bridge/views/Ledger.js+1−1
@@ -10,7 +10,7 @@ import * as secp256k1 from "secp256k1";
10
10
11import { LEDGER_LIVE_PATH, LEDGER_LEGACY_PATH } from "../lib/ledger";
11import { LEDGER_LIVE_PATH, LEDGER_LEGACY_PATH } from "../lib/ledger";
12import { ROUTE_NAMES } from "../lib/routeNames";
12import { ROUTE_NAMES } from "../lib/routeNames";
13−import { withHistory } from "../lib/history";
13+import { withHistory } from "../store/history";
14
14
15const chopHdPrefix = str => (str.slice(0, 2) === "m/" ? str.slice(2) : str);
15const chopHdPrefix = str => (str.slice(0, 2) === "m/" ? str.slice(2) : str);
16
16
src/bridge/views/Mnemonic.js+1−1
@@ -11,7 +11,7 @@ import {
11import { Row, Col, H1 } from "../components/Base";
11import { Row, Col, H1 } from "../components/Base";
12
12
13import { ROUTE_NAMES } from "../lib/routeNames";
13import { ROUTE_NAMES } from "../lib/routeNames";
14−import { withHistory } from "../lib/history";
14+import { withHistory } from "../store/history";
15import { DEFAULT_HD_PATH, walletFromMnemonic } from "../lib/wallet";
15import { DEFAULT_HD_PATH, walletFromMnemonic } from "../lib/wallet";
16
16
17class Mnemonic extends React.Component {
17class Mnemonic extends React.Component {
src/bridge/views/Network.js+1−1
@@ -9,7 +9,7 @@ import Web3 from "web3";
9import { CONTRACT_ADDRESSES } from "../lib/contracts";
9import { CONTRACT_ADDRESSES } from "../lib/contracts";
10import { NETWORK_NAMES, renderNetworkType } from "../lib/network";
10import { NETWORK_NAMES, renderNetworkType } from "../lib/network";
11import { ROUTE_NAMES } from "../lib/routeNames";
11import { ROUTE_NAMES } from "../lib/routeNames";
12−import { withHistory } from "../lib/history";
12+import { withHistory } from "../store/history";
13
13
14class Network extends React.Component {
14class Network extends React.Component {
15 constructor(props) {
15 constructor(props) {
src/bridge/views/Point.js+1−1
@@ -10,7 +10,7 @@ import ReactSVGComponents from "../components/ReactSVGComponents";
10import KeysAndMetadata from "./Point/KeysAndMetadata";
10import KeysAndMetadata from "./Point/KeysAndMetadata";
11import Actions from "./Point/Actions";
11import Actions from "./Point/Actions";
12import { Row, Col, H1, H3 } from "../components/Base";
12import { Row, Col, H1, H3 } from "../components/Base";
13−import { withHistory } from "../lib/history";
13+import { withHistory } from "../store/history";
14
14
15class Point extends React.Component {
15class Point extends React.Component {
16 constructor(props) {
16 constructor(props) {
src/bridge/views/Point/Actions.js+1−1
@@ -6,7 +6,7 @@ import { ETH_ZERO_ADDR, CURVE_ZERO_ADDR, eqAddr } from "../../lib/wallet";
6import { Row, Col, H2, P } from "../../components/Base";
6import { Row, Col, H2, P } from "../../components/Base";
7import { Button } from "../../components/Base";
7import { Button } from "../../components/Base";
8import { ROUTE_NAMES } from "../../lib/routeNames";
8import { ROUTE_NAMES } from "../../lib/routeNames";
9−import { useHistory } from "../../lib/history";
9+import { useHistory } from "../../store/history";
10
10
11const isPlanet = point =>
11const isPlanet = point =>
12 azimuth.getPointSize(point) === azimuth.PointSize.Planet;
12 azimuth.getPointSize(point) === azimuth.PointSize.Planet;
src/bridge/views/Points.js+1−1
@@ -6,7 +6,7 @@ import * as azimuth from "azimuth-js";
6import PointList from "../components/PointList";
6import PointList from "../components/PointList";
7import { NETWORK_NAMES } from "../lib/network";
7import { NETWORK_NAMES } from "../lib/network";
8import { ROUTE_NAMES } from "../lib/routeNames";
8import { ROUTE_NAMES } from "../lib/routeNames";
9−import { withHistory } from "../lib/history";
9+import { withHistory } from "../store/history";
10import { ETH_ZERO_ADDR, eqAddr } from "../lib/wallet";
10import { ETH_ZERO_ADDR, eqAddr } from "../lib/wallet";
11
11
12const hasTransferProxy = (cache, point) =>
12const hasTransferProxy = (cache, point) =>
src/bridge/views/PrivateKey.js+1−1
@@ -5,7 +5,7 @@ import { RequiredInput, InnerLabel, InputCaption } from "../components/Base";
5import { Row, Col, H1 } from "../components/Base";
5import { Row, Col, H1 } from "../components/Base";
6
6
7import { ROUTE_NAMES } from "../lib/routeNames";
7import { ROUTE_NAMES } from "../lib/routeNames";
8−import { withHistory } from "../lib/history";
8+import { withHistory } from "../store/history";
9import { EthereumWallet } from "../lib/wallet";
9import { EthereumWallet } from "../lib/wallet";
10
10
11class PrivateKey extends React.Component {
11class PrivateKey extends React.Component {
src/bridge/views/SentTransaction.js+1−1
@@ -5,7 +5,7 @@ import { Row, Col, H1, H3, P, Warning, Anchor } from "../components/Base";
5import { Button } from "../components/Base";
5import { Button } from "../components/Base";
6
6
7import { ROUTE_NAMES } from "../lib/routeNames";
7import { ROUTE_NAMES } from "../lib/routeNames";
8−import { useHistory } from "../lib/history";
8+import { useHistory } from "../store/history";
9import { BRIDGE_ERROR, renderTxnError } from "../lib/error";
9import { BRIDGE_ERROR, renderTxnError } from "../lib/error";
10import { NETWORK_NAMES } from "../lib/network";
10import { NETWORK_NAMES } from "../lib/network";
11import { withTxnConfirmations } from "../store/txnConfirmations";
11import { withTxnConfirmations } from "../store/txnConfirmations";
src/bridge/views/Shards.js+1−1
@@ -14,7 +14,7 @@ import * as kg from "urbit-key-generation/dist/index";
14import * as ob from "urbit-ob";
14import * as ob from "urbit-ob";
15
15
16import { ROUTE_NAMES } from "../lib/routeNames";
16import { ROUTE_NAMES } from "../lib/routeNames";
17−import { withHistory } from "../lib/history";
17+import { withHistory } from "../store/history";
18import { urbitWalletFromTicket } from "../lib/wallet";
18import { urbitWalletFromTicket } from "../lib/wallet";
19
19
20const placeholder = len => {
20const placeholder = len => {
src/bridge/views/Ticket.js+1−1
@@ -13,7 +13,7 @@ import { Row, Col, H1, P } from "../components/Base";
13
13
14import { randomPatq } from "../lib/lib";
14import { randomPatq } from "../lib/lib";
15import { ROUTE_NAMES } from "../lib/routeNames";
15import { ROUTE_NAMES } from "../lib/routeNames";
16−import { withHistory } from "../lib/history";
16+import { withHistory } from "../store/history";
17import { urbitWalletFromTicket } from "../lib/wallet";
17import { urbitWalletFromTicket } from "../lib/wallet";
18
18
19class Ticket extends React.Component {
19class Ticket extends React.Component {
src/bridge/views/Trezor.js+1−1
@@ -9,7 +9,7 @@ import * as secp256k1 from "secp256k1";
9
9
10import { TREZOR_PATH } from "../lib/trezor";
10import { TREZOR_PATH } from "../lib/trezor";
11import { ROUTE_NAMES } from "../lib/routeNames";
11import { ROUTE_NAMES } from "../lib/routeNames";
12−import { withHistory } from "../lib/history";
12+import { withHistory } from "../store/history";
13
13
14class Trezor extends React.Component {
14class Trezor extends React.Component {
15 constructor(props) {
15 constructor(props) {
src/bridge/views/ViewPoint.js+1−1
@@ -7,7 +7,7 @@ import { Row, Col, H1, P } from "../components/Base";
7import { InnerLabel, PointInput, ValidatedSigil } from "../components/Base";
7import { InnerLabel, PointInput, ValidatedSigil } from "../components/Base";
8
8
9import { ROUTE_NAMES } from "../lib/routeNames";
9import { ROUTE_NAMES } from "../lib/routeNames";
10−import { withHistory } from "../lib/history";
10+import { withHistory } from "../store/history";
11
11
12class ViewPoint extends React.Component {
12class ViewPoint extends React.Component {
13 constructor(props) {
13 constructor(props) {
src/bridge/views/Wallet.js+1−1
@@ -5,7 +5,7 @@ import { InnerLabelDropdown } from "../components/Base";
5import { Row, Col } from "../components/Base";
5import { Row, Col } from "../components/Base";
6
6
7import { ROUTE_NAMES } from "../lib/routeNames";
7import { ROUTE_NAMES } from "../lib/routeNames";
8−import { withHistory } from "../lib/history";
8+import { withHistory } from "../store/history";
9import { WALLET_NAMES, renderWalletType } from "../lib/wallet";
9import { WALLET_NAMES, renderWalletType } from "../lib/wallet";
10
10
11class Wallet extends React.Component {
11class Wallet extends React.Component {