James Prado 816ce3180f Translation Updates (#1323)
* Update account view routing

* Temporarily add unicode character to translated strings for testing

* Temporarily select add unicode to all untranslated strings

* Format changes

* Add all english translations for /account & /generate

* Add the rest of the english translations

* Add a few more missing translations

* Update en translations

* Get selectedLanguage from localstorage instead of redux sttate

* Update snapshots

* Add missing translation keys & Update translate functs & change variable prefix

* translate all markdown strings & remove old translation strings

* Update snapshot

* Add a few more translation strs

* Move raw strings being translated into json

* All translation keys are now Uppercase

* Fix up the last few translations

* Update snapshot

* Uppercase de translation strings

* Bring back shapeshift logo on swap

* Fix contracts tab translations

* Fix a few more translations

* Fix translations

* remove debugging stuff

* Update snapshots

* Use react.fragment as markdown root renderer

* Seperate markdown translations into their own function

* Clean up translation functions

* Clean up translation functions

* Update snapshot

* Fix some broken translation strings

* Add prettier ignore file
2018-03-21 22:50:25 -05:00

68 lines
1.9 KiB
TypeScript

import React from 'react';
import classnames from 'classnames';
import { translateRaw } from 'translations';
import './Word.scss';
import { Input } from 'components/ui';
interface Props {
index: number;
word: string;
value: string;
isReadOnly: boolean;
onChange(index: number, value: string): void;
}
interface State {
isShowingWord: boolean;
}
export default class MnemonicWord extends React.Component<Props, State> {
public state = {
isShowingWord: false
};
public render() {
const { index, word, value, isReadOnly } = this.props;
const { isShowingWord } = this.state;
const readOnly = isReadOnly || isShowingWord;
return (
<div className="input-group-wrapper MnemonicWord">
<label className="input-group input-group-inline ENSInput-name">
<span className="input-group-addon input-group-addon--transparent">{index + 1}.</span>
<Input
className={`MnemonicWord-word-input ${!isReadOnly && 'border-rad-right-0'}`}
value={readOnly ? word : value}
onChange={this.handleChange}
readOnly={readOnly}
/>
{!isReadOnly && (
<span
onClick={this.toggleShow}
aria-label={translateRaw('GEN_ARIA_2')}
role="button"
className="MnemonicWord-word-toggle input-group-addon"
>
<i
className={classnames(
'fa',
isShowingWord && 'fa-eye-slash',
!isShowingWord && 'fa-eye'
)}
/>
</span>
)}
</label>
</div>
);
}
private handleChange = (ev: React.FormEvent<HTMLInputElement>) => {
this.props.onChange(this.props.index, ev.currentTarget.value);
};
private toggleShow = () => {
this.setState({ isShowingWord: !this.state.isShowingWord });
};
}