Update @types/react to the latest version 🚀 (#912)

* chore(package): update @types/react to version 16.0.35

* Add stricter typing via function overloads

* Fix rest of aria translations
This commit is contained in:
greenkeeper[bot] 2018-02-05 17:25:01 -06:00 committed by Daniel Ternyak
parent 39da226cd1
commit 37e34381a3
4 changed files with 9 additions and 7 deletions

View File

@ -33,7 +33,7 @@ export default class DownloadWallet extends Component<Props, State> {
role="button"
className="DlWallet-download btn btn-primary btn-lg"
aria-label="Download Keystore File (UTC / JSON · Recommended · Encrypted)"
aria-describedby={translate('x_KeystoreDesc')}
aria-describedby={translate('x_KeystoreDesc', true)}
download={filename}
href={this.getBlob()}
onClick={this.handleDownloadKeystore}

View File

@ -20,7 +20,7 @@ const PaperWallet: React.SFC<Props> = props => (
<input
className="GenPaper-private form-control"
value={stripHexPrefix(props.privateKey)}
aria-label={translate('x_PrivKey')}
aria-label={translate('x_PrivKey', true)}
aria-describedby="x_PrivKeyDesc"
type="text"
readOnly={true}

View File

@ -42,19 +42,21 @@ export function getTranslators() {
'TranslatorName_5'
].filter(x => {
const translated = translate(x);
if (typeof translated === 'string') {
return !!translated.trim();
}
return !!translated;
});
}
export type TranslateType = React.ReactElement<any> | string;
export default function translate(key: string, textOnly: boolean = false): TranslateType {
function translate(key: string, textOnly?: false): React.ReactElement<any>;
function translate(key: string, textOnly: true): string;
function translate(key: string, textOnly: boolean = false) {
return textOnly ? translateRaw(key) : <Translate translationKey={key} />;
}
export default translate;
export function translateRaw(key: string) {
const lang = getLanguageSelection(configuredStore.getState());

View File

@ -61,7 +61,7 @@
"@types/qrcode": "0.8.0",
"@types/qrcode.react": "0.6.2",
"@types/query-string": "5.0.1",
"@types/react": "16.0.34",
"@types/react": "16.0.35",
"@types/react-dom": "16.0.3",
"@types/react-redux": "5.0.14",
"@types/react-router-dom": "4.2.3",