Skip to content

Commit

Permalink
Move some utility components
Browse files Browse the repository at this point in the history
  • Loading branch information
svk31 committed Oct 5, 2017
1 parent c054979 commit 0065607
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 29 deletions.
3 changes: 2 additions & 1 deletion app/assets/locales/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@
"asset_issue": "Issue {amount} to {to} using {account}",
"asset_reserve": "Reserve (burn) {amount} using {account}",
"vesting_balance_withdraw": "Withdraw {amount} from vesting balance of {account}",
"feed_producer": "Update the feed producers for the asset {asset} using the account {account}"
"feed_producer": "Update the feed producers for the asset {asset} using the account {account}",
"call_order_update": "Change {account} {debtSymbol} debt by {debt} and collateral by {collateral}"
},
"transaction": {
"confirm": "Please confirm the transaction",
Expand Down
7 changes: 5 additions & 2 deletions app/components/Account/AccountOverview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {Link} from "react-router/es";
import ChainTypes from "../Utility/ChainTypes";
import FormattedAsset from "../Utility/FormattedAsset";
import BindToChainState from "../Utility/BindToChainState";
import LinkToAssetById from "../Utility/LinkToAssetById";
import utils from "common/utils";
import BorrowModal from "../Modal/BorrowModal";
import ReactTooltip from "react-tooltip";
Expand Down Expand Up @@ -207,7 +208,9 @@ class AccountOverview extends React.Component {
}
balances.push(
<tr key={asset.get("symbol")} style={{maxWidth: "100rem"}}>
<td><AssetName name={asset.get("symbol")} /></td>
<td>
<LinkToAssetById asset={asset.get("id")} />
</td>
<td style={{textAlign: "right"}}>
{hasBalance || hasOnOrder ? <BalanceComponent balance={balance} hide_asset /> : null}
</td>
Expand Down Expand Up @@ -300,7 +303,7 @@ class AccountOverview extends React.Component {
if (includeAsset && visible || !includeAsset && !visible) balances.push(
<tr key={"zz" + a} style={{maxWidth: "100rem"}}>
<td>
<AssetName name={a} />
<LinkToAssetById asset={asset.get("id")} />
</td>
<td colSpan="3"></td>
<td style={{textAlign: "center"}}>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Account/AccountVotingProxy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import BindToChainState from "../Utility/BindToChainState";
import ChainTypes from "../Utility/ChainTypes";
import Translate from "react-translate-component";
import AccountImage from "../Account/AccountImage";
import LinkToAccountById from "../Blockchain/LinkToAccountById";
import LinkToAccountById from "../Utility/LinkToAccountById";
import {List} from "immutable";

class AccountVotingProxy extends React.Component {
Expand Down
2 changes: 1 addition & 1 deletion app/components/Account/AccountWhitelist.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Immutable from "immutable";
import Translate from "react-translate-component";
import ChainTypes from "../Utility/ChainTypes";
import BindToChainState from "../Utility/BindToChainState";
import LinkToAccountById from "../Blockchain/LinkToAccountById";
import LinkToAccountById from "../Utility/LinkToAccountById";
import WalletApi from "api/WalletApi";
import WalletDb from "stores/WalletDb.js";

Expand Down
2 changes: 1 addition & 1 deletion app/components/Account/NestedApprovalState.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ChainTypes from "../Utility/ChainTypes";
import BindToChainState from "../Utility/BindToChainState";
import utils from "common/utils";
import Icon from "../Icon/Icon";
import LinkToAccountById from "../Blockchain/LinkToAccountById";
import LinkToAccountById from "../Utility/LinkToAccountById";
import pu from "common/permission_utils";
import {cloneDeep} from "lodash";
import {ChainStore} from "bitsharesjs/es";
Expand Down
2 changes: 1 addition & 1 deletion app/components/Account/VotingAccountsList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {ChainStore} from "bitsharesjs/es";
import ChainTypes from "../Utility/ChainTypes";
import FormattedAsset from "../Utility/FormattedAsset";
import BindToChainState from "../Utility/BindToChainState";
import LinkToAccountById from "../Blockchain/LinkToAccountById";
import LinkToAccountById from "../Utility/LinkToAccountById";
import counterpart from "counterpart";

function getWitnessOrCommittee(type, acct) {
Expand Down
2 changes: 1 addition & 1 deletion app/components/Account/WorkerApproval.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import utils from "common/utils";
import ChainTypes from "../Utility/ChainTypes";
import FormattedAsset from "../Utility/FormattedAsset";
import VestingBalance from "../Utility/VestingBalance";
import LinkToAccountById from "../Blockchain/LinkToAccountById";
import LinkToAccountById from "../Utility/LinkToAccountById";
import BindToChainState from "../Utility/BindToChainState";
import {EquivalentValueComponent} from "../Utility/EquivalentValueComponent";
import Icon from "components/Icon/Icon";
Expand Down
2 changes: 1 addition & 1 deletion app/components/Blockchain/Asset.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import {Link} from "react-router/es";
import Translate from "react-translate-component";
import LinkToAccountById from "./LinkToAccountById";
import LinkToAccountById from "../Utility/LinkToAccountById";
import ChainTypes from "../Utility/ChainTypes";
import BindToChainState from "../Utility/BindToChainState";
import FormattedAsset from "../Utility/FormattedAsset";
Expand Down
2 changes: 1 addition & 1 deletion app/components/Blockchain/Block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Transaction from "./Transaction";
import Translate from "react-translate-component";
import ChainTypes from "../Utility/ChainTypes";
import BindToChainState from "../Utility/BindToChainState";
import LinkToWitnessById from "./LinkToWitnessById";
import LinkToWitnessById from "../Utility/LinkToWitnessById";

class TransactionList extends React.Component {

Expand Down
4 changes: 2 additions & 2 deletions app/components/Blockchain/Operation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Translate from "react-translate-component";
import counterpart from "counterpart";
import utils from "common/utils";
import BlockTime from "./BlockTime";
import LinkToAccountById from "../Blockchain/LinkToAccountById";
import LinkToAssetById from "../Blockchain/LinkToAssetById";
import LinkToAccountById from "../Utility/LinkToAccountById";
import LinkToAssetById from "../Utility/LinkToAssetById";
import BindToChainState from "../Utility/BindToChainState";
import ChainTypes from "../Utility/ChainTypes";
import TranslateWithLinks from "../Utility/TranslateWithLinks";
Expand Down
16 changes: 11 additions & 5 deletions app/components/Blockchain/ProposedOperation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Translate from "react-translate-component";
import counterpart from "counterpart";
import market_utils from "common/market_utils";
import utils from "common/utils";
import LinkToAccountById from "../Blockchain/LinkToAccountById";
import LinkToAssetById from "../Blockchain/LinkToAssetById";
import LinkToAccountById from "../Utility/LinkToAccountById";
import LinkToAssetById from "../Utility/LinkToAssetById";
import BindToChainState from "../Utility/BindToChainState";
import FormattedPrice from "../Utility/FormattedPrice";
import {ChainStore, ChainTypes as grapheneChainTypes} from "bitsharesjs/es";
Expand Down Expand Up @@ -203,9 +203,15 @@ class ProposedOperation extends React.Component {
color = "warning";
column = (
<span>
{this.linkToAccount(op[1].funding_account)}&nbsp;
<Translate component="span" content="proposal.call_order_update" />
&nbsp;{this.linkToAsset(op[1].delta_debt.asset_id)}
<TranslateWithLinks
string="proposal.call_order_update"
keys={[
{type: "account", value: op[1].funding_account, arg: "account"},
{type: "asset", value: op[1].delta_debt.asset_id, arg: "debtSymbol"},
{type: "amount", value: op[1].delta_debt, arg: "debt"},
{type: "amount", value: op[1].delta_collateral, arg: "collateral"}
]}
/>
</span>
);
break;
Expand Down
4 changes: 2 additions & 2 deletions app/components/Blockchain/Transaction.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import classNames from "classnames";
import {FormattedDate} from "react-intl";
import Inspector from "react-json-inspector";
import utils from "common/utils";
import LinkToAccountById from "../Blockchain/LinkToAccountById";
import LinkToAssetById from "../Blockchain/LinkToAssetById";
import LinkToAccountById from "../Utility/LinkToAccountById";
import LinkToAssetById from "../Utility/LinkToAssetById";
import FormattedPrice from "../Utility/FormattedPrice";
import account_constants from "chain/account_constants";
import Icon from "../Icon/Icon";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ZfApi from "react-foundation-apps/src/utils/foundation-api";
import AccountBalance from "../../Account/AccountBalance";
import BlockTradesDepositAddressCache from "common/BlockTradesDepositAddressCache";
import AssetName from "components/Utility/AssetName";
import LinkToAccountById from "components/Blockchain/LinkToAccountById";
import LinkToAccountById from "components/Utility/LinkToAccountById";
import {requestDepositAddress} from "common/blockTradesMethods";
import { blockTradesAPIs } from "api/apiConfig";

Expand Down
2 changes: 1 addition & 1 deletion app/components/Explorer/Assets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import SettingsActions from "actions/SettingsActions";
import {Link} from "react-router/es";
import Immutable from "immutable";
import Translate from "react-translate-component";
import LinkToAccountById from "../Blockchain/LinkToAccountById";
import LinkToAccountById from "../Utility/LinkToAccountById";
import assetUtils from "common/asset_utils";
import counterpart from "counterpart";
import FormattedAsset from "../Utility/FormattedAsset";
Expand Down
2 changes: 1 addition & 1 deletion app/components/Explorer/Blocks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BlockchainActions from "actions/BlockchainActions";
import Translate from "react-translate-component";
import {FormattedDate} from "react-intl";
import Operation from "../Blockchain/Operation";
import LinkToWitnessById from "../Blockchain/LinkToWitnessById";
import LinkToWitnessById from "../Utility/LinkToWitnessById";
import ChainTypes from "../Utility/ChainTypes";
import BindToChainState from "../Utility/BindToChainState";
import TransactionChart from "./TransactionChart";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import {Link} from "react-router/es";
import ChainTypes from "../Utility/ChainTypes";
import BindToChainState from "../Utility/BindToChainState";
import ChainTypes from "./ChainTypes";
import BindToChainState from "./BindToChainState";

class LinkToAccountById extends React.Component {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import {Link} from "react-router/es";
import ChainTypes from "../Utility/ChainTypes";
import BindToChainState from "../Utility/BindToChainState";
import AssetName from "../Utility/AssetName";
import ChainTypes from "./ChainTypes";
import BindToChainState from "./BindToChainState";
import AssetName from "./AssetName";

class LinkToAssetById extends React.Component {
static propTypes = {
Expand Down
4 changes: 2 additions & 2 deletions app/components/Utility/TranslateWithLinks.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import counterpart from "counterpart";
import utils from "common/utils";
import LinkToAccountById from "../Blockchain/LinkToAccountById";
import LinkToAssetById from "../Blockchain/LinkToAssetById";
import LinkToAccountById from "../Utility/LinkToAccountById";
import LinkToAssetById from "../Utility/LinkToAssetById";
import {Link} from "react-router/es";
import FormattedAsset from "../Utility/FormattedAsset";
import FormattedPrice from "../Utility/FormattedPrice";
Expand Down

0 comments on commit 0065607

Please sign in to comment.