diff --git a/packages/app-staking/src/Actions/Account/index.tsx b/packages/app-staking/src/Actions/Account/index.tsx index f42042ce72..4de20edfd6 100644 --- a/packages/app-staking/src/Actions/Account/index.tsx +++ b/packages/app-staking/src/Actions/Account/index.tsx @@ -12,7 +12,7 @@ import { KeyringSectionOption } from '@polkadot/ui-keyring/options/types'; import { Popup } from 'semantic-ui-react'; import React from 'react'; import styled from 'styled-components'; -import { AddressInfo, AddressMini, AddressRow, Button, Card, Menu, RecentlyOffline, TxButton } from '@polkadot/ui-app'; +import { AddressCard, AddressInfo, AddressMini, AddressRow, Button, Menu, RecentlyOffline, TxButton } from '@polkadot/ui-app'; import { withCalls } from '@polkadot/ui-api'; import BondExtra from './BondExtra'; @@ -57,39 +57,26 @@ type State = { const Wrapper = styled.div` display: flex; - .ui.button.tiny { - visibility: visible - } - .staking--Accounts { - flex: 2; + flex: 1; } .staking--Account-detail.actions{ display: inline-block; vertical-align: top; + margin-top: .5rem; + margin-bottom: 1.5rem; - .staking--label { - margin: .5rem 1.75rem -0.5rem 4.5rem; - text-align: left; - } + &:last-child { + margin: 0; } } - .staking--Actions-Infos { - flex: 3; + .staking--Infos { + flex: 1; display: flex; flex-direction: column; - .buttons { - margin-bottom: 1rem; - flex: 0; - - button { - margin-right: .25rem; - } - } - .staking--balances { div { justify-content: flex-end; @@ -116,6 +103,14 @@ const Wrapper = styled.div` margin: 0 2.25rem -.75rem 0; } } + + .ui--Row-buttons .ui--Button-Group { + margin-right: .25rem; + + .ui.tiny.icon.button { + visibility: visible; + } + } `; function toIdString (id?: AccountId | null): string | null { @@ -168,9 +163,10 @@ class Account extends React.PureComponent { } render () { - const { isActiveStash } = this.state; + const { t } = this.props; + const { isActiveStash, stashId } = this.state; - if (!isActiveStash) { + if (!isActiveStash || !stashId) { return null; } @@ -179,7 +175,21 @@ class Account extends React.PureComponent { // This is deliberate in order to display the Component modals in a performant matter later on // because their state will already be loaded. return ( - + {this.renderBondExtra()} {this.renderSetValidatorPrefs()} {this.renderNominate()} @@ -190,21 +200,17 @@ class Account extends React.PureComponent { {this.renderValidate()}
- {this.renderStashAccount()} {this.renderControllerAccount()} {this.renderSessionAccount()}
-
-
- {this.renderButtons()} -
+
{this.renderInfos()}
{this.renderNominee()}
- + ); } @@ -299,10 +305,10 @@ class Account extends React.PureComponent { return (
- { return (
- { ); } - private renderStashAccount () { - const { accountId, t } = this.props; - - return ( -
- - -
- ); - } - private renderNominate () { const { stashOptions } = this.props; const { controllerId, isNominateOpen, nominees, stashId } = this.state; diff --git a/packages/ui-app/src/AddressCard.tsx b/packages/ui-app/src/AddressCard.tsx index fee6a1daaf..da9d5f1d8b 100644 --- a/packages/ui-app/src/AddressCard.tsx +++ b/packages/ui-app/src/AddressCard.tsx @@ -44,6 +44,11 @@ export default styled(translate(AddressCard))` flex-direction: column; justify-content: space-between; + .ui--Row-buttons .ui--Button-Group .ui.button { + visibility: visible; + margin-right: .25rem; + } + .ui--AddressCard-explorer { margin: 0 -0.25rem -0.5rem 0; text-align: right; diff --git a/packages/ui-app/src/AddressRow.tsx b/packages/ui-app/src/AddressRow.tsx index 20e89f5b85..3de48b9d26 100644 --- a/packages/ui-app/src/AddressRow.tsx +++ b/packages/ui-app/src/AddressRow.tsx @@ -23,6 +23,7 @@ export type Props = I18nProps & RowProps & { bonded?: BN | Array, isContract?: boolean, isValid?: boolean, + label?: string, value: AccountId | AccountIndex | Address | string | null, withAddressOrName?: boolean, withBalance?: boolean | BalanceActiveType, @@ -82,6 +83,7 @@ class AddressRow extends Row {
{this.renderIcon()}
+ {this.renderLabel()} {this.renderAddressAndName()} {this.renderAccountIndex()} {!isContract && this.renderBalances()} @@ -205,6 +207,18 @@ class AddressRow extends Row { ); } + private renderLabel () { + const { label } = this.props; + + if (!label) { + return null; + } + + return ( + + ); + } + protected saveName = () => { const { address, name } = this.state; const trimmedName = name.trim(); diff --git a/packages/ui-app/src/Row.tsx b/packages/ui-app/src/Row.tsx index d8f8e3d1f8..6be3ff66fa 100644 --- a/packages/ui-app/src/Row.tsx +++ b/packages/ui-app/src/Row.tsx @@ -96,6 +96,10 @@ export const styles = ` margin-right: 1rem; padding: 0.25rem 0 0; + .account-label{ + margin: -0.75rem 0 0 0 + } + * { vertical-align: middle; }