From 55593746764d499dbd34ae54fc29cd5192995888 Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Fri, 3 Mar 2017 14:32:52 +0100 Subject: [PATCH] Fix Account Selection in Signer (#4744) * Can pass FormattedMessage to Input (eg. Status // RPC Enabled) * Simple fixed-width fix for Accoutn Selection in Parity Signer --- js/src/ui/Form/Input/input.js | 16 ++++++++++++++-- js/src/views/ParityBar/parityBar.css | 2 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/js/src/ui/Form/Input/input.js b/js/src/ui/Form/Input/input.js index 9491bb2d3..44906ad93 100644 --- a/js/src/ui/Form/Input/input.js +++ b/js/src/ui/Form/Input/input.js @@ -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, @@ -79,7 +83,8 @@ export default class Input extends Component { style: PropTypes.object, value: PropTypes.oneOfType([ PropTypes.number, - PropTypes.string + PropTypes.string, + PropTypes.node ]) }; @@ -135,6 +140,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 (
{ this.renderCopyButton() } @@ -169,7 +181,7 @@ export default class Input extends Component { underlineStyle={ underlineStyle } underlineFocusStyle={ underlineFocusStyle } underlineShow={ !hideUnderline } - value={ value } + value={ textValue } > { children } diff --git a/js/src/views/ParityBar/parityBar.css b/js/src/views/ParityBar/parityBar.css index 265bf7894..11ebce073 100644 --- a/js/src/views/ParityBar/parityBar.css +++ b/js/src/views/ParityBar/parityBar.css @@ -42,6 +42,7 @@ $modalZ: 10001; .container { display: flex; flex-direction: column; + width: 100%; } .overlay { @@ -106,6 +107,7 @@ $modalZ: 10001; min-height: 30vh; max-height: 80vh; max-width: calc(100vw - 2em); + width: 960px; .content { flex: 1;