Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Fix Account Selection in Signer (#4744)
Browse files Browse the repository at this point in the history
* Can pass FormattedMessage to Input (eg. Status // RPC Enabled)

* Simple fixed-width fix for Accoutn Selection in Parity Signer
  • Loading branch information
ngotchac authored and arkpar committed Mar 3, 2017
1 parent 6758f68 commit 407eaff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 15 additions & 2 deletions js/src/ui/Form/Input/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ const UNDERLINE_FOCUSED = {
const NAME_ID = ' ';

export default class Input extends Component {
static contextTypes = {
intl: React.PropTypes.object.isRequired
};

static propTypes = {
allowCopy: PropTypes.oneOfType([
PropTypes.string,
Expand Down Expand Up @@ -78,7 +82,8 @@ export default class Input extends Component {
style: PropTypes.object,
value: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string
PropTypes.string,
PropTypes.node
])
};

Expand Down Expand Up @@ -134,6 +139,13 @@ export default class Input extends Component {
? UNDERLINE_FOCUSED
: readOnly && typeof focused !== 'boolean' ? { display: 'none' } : null;

const textValue = typeof value !== 'string' && (value && value.props)
? this.context.intl.formatMessage(
value.props,
value.props.values || {}
)
: value;

return (
<div className={ styles.container } style={ style }>
{ this.renderCopyButton() }
Expand Down Expand Up @@ -168,7 +180,8 @@ export default class Input extends Component {
underlineStyle={ underlineStyle }
underlineFocusStyle={ underlineFocusStyle }
underlineShow={ !hideUnderline }
value={ value }>
value={ textValue }
>
{ children }
</TextField>
</div>
Expand Down
4 changes: 3 additions & 1 deletion js/src/views/ParityBar/parityBar.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ $modalZ: 10001;
.container {
display: flex;
flex-direction: column;
width: 100%;
}

.overlay {
Expand Down Expand Up @@ -114,7 +115,8 @@ $modalZ: 10001;
flex-direction: column;
min-height: 30vh;
max-height: 80vh;
max-width: calc(100vw - 1em);
max-width: calc(100vw - 2em);
width: 960px;

.content {
flex: 1;
Expand Down

0 comments on commit 407eaff

Please sign in to comment.