Skip to content

Commit 2c0bc24

Browse files
authored
Merge pull request #339 from pbca26/worker
Worker
2 parents 077675f + e05ec6b commit 2c0bc24

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1052
-9377
lines changed

check-coin-explorers-availability.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let coinsToRemove = [];
2222
};
2323

2424
const checkApiEndpoints = async coin => {
25-
const getInfoRes = await Promise.all(coins[coin].api.map((value, index) => {
25+
const getInfoRes = await Promise.all(coins[coin].api.map((value) => {
2626
return getInfo(value);
2727
}));
2828
let longestBlockHeight = 0;

config-overrides.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = function override(config) {
1111
'buffer': require.resolve('buffer'),
1212
'stream': require.resolve('stream-browserify'),
1313
})
14+
config.resolve.alias['react-dom'] = '@hot-loader/react-dom';
1415
config.resolve.fallback = fallback;
1516
config.plugins = (config.plugins || []).concat([
1617
new webpack.ProvidePlugin({

electron-post-build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const fs = require('fs');
22
const buildPath = 'build';
33

4-
let files = [{
4+
const files = [{
55
name: `${buildPath}/index.html`,
66
data: fs.readFileSync(`${buildPath}/index.html`, 'utf-8'),
77
}];

make-coin-icons-sprites.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ const maxSize = { // max size of icon item
1212
},
1313
};
1414

15-
let iconsList = [];
15+
const iconsList = [];
1616
// get all icons in a list
1717
const directoryPath = path.join(__dirname, '/public/coins');
1818
const files = fs.readdirSync(directoryPath);
19-
files.forEach((file) => {
19+
files.forEach(file => {
2020
if (file.indexOf('.png') > -1) {
2121
iconsList.push(file.substr(0, file.indexOf('.png')));
2222
}
@@ -27,7 +27,7 @@ console.log(iconsList);
2727

2828
// generate spritesheet
2929
Spritesmith.run({
30-
src: iconsList.map((x) => `${__dirname}/public/coins/${x}.png`),
30+
src: iconsList.map(x => `${__dirname}/public/coins/${x}.png`),
3131
algorithm: 'binary-tree'
3232
}, (err, result) => {
3333
if (err) {
@@ -39,9 +39,9 @@ Spritesmith.run({
3939
//console.log(result.coordinates)
4040
//console.log(result.properties)
4141

42-
let coinsCss = [];
43-
let coinsCssResize = [];
44-
let resultKeys = Object.keys(result.coordinates);
42+
const coinsCss = [];
43+
const coinsCssResize = [];
44+
const resultKeys = Object.keys(result.coordinates);
4545

4646
for (let i = 0; i < iconsList.length; i++) {
4747
coinsCss.push(`

package-lock.json

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hw-kmd-wallet",
3-
"version": "0.3.6",
3+
"version": "0.3.7",
44
"author": "Luke Childs <[email protected]> (http://lukechilds.co.uk), Komodo Platform (https://komodoplatform.com)",
55
"description": "Komodo Hardware Wallet Web App",
66
"repository": "pbca26/hw-kmd-wallet",
@@ -9,6 +9,7 @@
99
"private": true,
1010
"dependencies": {
1111
"@fortawesome/fontawesome-free": "^5.6.0",
12+
"@hot-loader/react-dom": "^17.0.2",
1213
"@ledgerhq/hw-app-btc": "^6.27.1",
1314
"@ledgerhq/hw-transport": "^6.27.1",
1415
"@ledgerhq/hw-transport-web-ble": "^6.27.1",

src/AboutModal.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
isElectron,
66
shell,
77
} from './Electron';
8+
import Translate, {t} from './Translate';
89

910
const AboutModal = props => {
1011
const initialState = {
@@ -50,22 +51,22 @@ const AboutModal = props => {
5051
<li onClick={() => open()}>
5152
<i className="fa fa-copyright"></i>
5253
{props.sidebarSize === 'full' &&
53-
<span className="sidebar-item-title">About</span>
54+
<span className="sidebar-item-title"><Translate name="about_about" /></span>
5455
}
5556
</li>
5657
<Modal
57-
title="About"
58+
title={t('about_about')}
5859
show={state.isClosed === false}
5960
handleClose={() => close()}
6061
isCloseable={true}
6162
className="Modal-about">
6263
<p>
63-
<strong>Komodo Hardware Wallet App</strong> by {renderLink('https://github.com/atomiclabs', 'Atomic Labs')} and {renderLink('https://github.com/komodoplatform', 'Komodo Platform')}.
64+
<strong>Komodo Hardware Wallet App</strong> <Translate name="about_by_sm" /> {renderLink('https://github.com/atomiclabs', 'Atomic Labs')} <Translate name="about_and_sm" /> {renderLink('https://github.com/komodoplatform', 'Komodo Platform')}.
6465
</p>
6566
<p>
66-
The {renderLink(`https://github.com/${appInfo.repository}`, 'source code')} is licensed under {renderLink(`https://github.com/${appInfo.repository}/blob/master/LICENSE`, 'MIT')}.
67+
<Translate name="about_the" /> {renderLink(`https://github.com/${appInfo.repository}`, t('about_source_code'))} <Translate name="about_is_licensed" /> {renderLink(`https://github.com/${appInfo.repository}/blob/master/LICENSE`, 'MIT')}.
6768
<br />
68-
View the {renderLink(`https://github.com/${appInfo.repository}#usage`, 'README')} for usage instructions.
69+
<Translate name="about_view" /> {renderLink(`https://github.com/${appInfo.repository}#usage`, 'README')} <Translate name="about_usage_intructions" />.
6970
</p>
7071
</Modal>
7172
</React.Fragment>

src/Accounts.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import coinsList from './lib/coins';
1414
import {checkTimestamp} from './lib/time';
1515
import './Accounts.scss';
1616
import './Account.scss';
17+
import Translate, {t} from './Translate';
1718

1819
const Account = props => {
1920
const render = () => {
@@ -59,7 +60,7 @@ const Account = props => {
5960
{account.isRewardsOverdue &&
6061
<span
6162
className="kmd-rewards-account-overdue-badge"
62-
title="Rewards claim overdue!">
63+
title={t('accounts_rewards_overdue')}>
6364
<i>!</i>
6465
</span>
6566
}
@@ -88,7 +89,7 @@ const Accounts = ({
8889
<div className="container content">
8990
<div className="accounts-block">
9091
<h4>
91-
{activeAccount !== null ? 'Account details' : 'Accounts' }
92+
{activeAccount !== null ? t('accounts_account_details') : t('accounts_accounts') }
9293
</h4>
9394
{activeAccount === null &&
9495
<CoinSettingsModal
@@ -102,10 +103,10 @@ const Accounts = ({
102103
<table>
103104
<thead>
104105
<tr>
105-
<th>{activeAccount !== null ? '' : 'Account'}</th>
106-
<th>Balance</th>
106+
<th>{activeAccount !== null ? '' : t('accounts_account')}</th>
107+
<th><Translate name="accounts_balance" /></th>
107108
{activeCoin === 'KMD' &&
108-
<th>Rewards</th>
109+
<th><Translate name="accounts_rewards" /></th>
109110
}
110111
</tr>
111112
</thead>
@@ -130,13 +131,13 @@ const Accounts = ({
130131
{isElectron &&
131132
<a
132133
href="!#"
133-
onClick={() => shell.openExternal('https://github.com/pbca26/hw-kmd-wallet/wiki/How-to-use-address-discovery-options-to-claim-airdrop-coins')}>Unable to find airdrop coins?</a>
134+
onClick={() => shell.openExternal('https://github.com/pbca26/hw-kmd-wallet/wiki/How-to-use-address-discovery-options-to-claim-airdrop-coins')}><Translate name="accounts_unable_to_find_airdrop" /></a>
134135
}
135136
{!isElectron &&
136137
<a
137138
target="_blank"
138139
rel="noopener noreferrer"
139-
href="https://github.com/pbca26/hw-kmd-wallet/wiki/How-to-use-address-discovery-options-to-claim-airdrop-coins">Unable to find airdrop coins?</a>
140+
href="https://github.com/pbca26/hw-kmd-wallet/wiki/How-to-use-address-discovery-options-to-claim-airdrop-coins"><Translate name="accounts_unable_to_find_airdrop" /></a>
140141
}
141142
</div>
142143
}

src/ActionListModal.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import Modal from './Modal';
33
import Boolean from './Boolean';
44
import './ActionListModal.scss';
5+
import Translate from './Translate';
56

67
const ActionListModal = ({
78
children,
@@ -58,14 +59,14 @@ const ActionListModal = ({
5859

5960
{error ? (
6061
<div className="notification is-danger">
61-
<strong>Error</strong>
62+
<strong><Translate name="action_list_modal_error" /></strong>
6263
<p>{error}</p>
6364
</div>
6465
) : null}
6566

6667
{success ? (
6768
<div className="notification is-success">
68-
<strong>Success</strong>
69+
<strong><Translate name="action_list_modal_success" /></strong>
6970
<p>{success}</p>
7071
</div>
7172
) : null}

src/AddAccount.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import updateActionState from './lib/update-action-state';
66
import {VENDOR} from './constants';
77
import ActionListModal from './ActionListModal';
88
import {writeLog} from './Debug';
9+
import Translate, {t} from './Translate';
910

1011
const AddAccount = props => {
1112
const initialState = {
@@ -14,12 +15,12 @@ const AddAccount = props => {
1415
actions: {
1516
connect: {
1617
icon: 'fab fa-usb',
17-
description: props.vendor === 'ledger' ? <div>Connect and unlock your Ledger, then open the Komodo app on your device.</div> : <div>Connect and unlock your Trezor.</div>,
18+
description: props.vendor === 'ledger' ? <div><Translate name="common_connect_and_unlock_ledger" /></div> : <div><Translate name="common_connect_and_unlock_trezor" /></div>,
1819
state: null
1920
},
2021
approve: {
2122
icon: 'fas fa-microchip',
22-
description: <div>Approve all public key export requests on your device. <strong>There will be multiple requests</strong>.</div>,
23+
description: <div><Translate name="common_approve_public_key" /> <strong><Translate name="common_multiple_req" /></strong>.</div>,
2324
state: null
2425
}
2526
}
@@ -42,7 +43,7 @@ const AddAccount = props => {
4243
updateActionState({setState}, currentAction, 'loading');
4344
const hwIsAvailable = await hw[vendor].isAvailable();
4445
if (!hwIsAvailable) {
45-
throw new Error(`${VENDOR[vendor]} device is unavailable!`);
46+
throw new Error(t('common_error_device', VENDOR[vendor]));
4647
}
4748
updateActionState({setState}, currentAction, true);
4849

@@ -96,7 +97,7 @@ const AddAccount = props => {
9697
show={isCheckingRewards}
9798
className="Scan-balances-modal">
9899
<p>
99-
Exporting a public key from your {VENDOR[vendor]} device. Please approve the public key export request on your device.
100+
<Translate name="common_exporting_public_key" template={VENDOR[vendor]} />
100101
</p>
101102
</ActionListModal>
102103
</React.Fragment>

0 commit comments

Comments
 (0)