mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-16 21:16:35 +00:00
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:
parent
39da226cd1
commit
37e34381a3
@ -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}
|
||||
|
@ -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}
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user