diff --git a/crowdin.yml b/crowdin.yml index 99323cd8bc..ebaf0309bc 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -17,6 +17,7 @@ files: it: it-IT sk: sk-SK cs: cs-CZ + vi: vi-VN - source: /packages/yoroi-extension/app/i18n/locales/**/en-US.md translation: /packages/yoroi-extension/app/i18n/locales/**/%locale%.md languages_mapping: @@ -34,4 +35,5 @@ files: it: it-IT sk: sk-SK cs: cs-CZ + vi: vi-VN content_segmentation: 0 diff --git a/packages/yoroi-extension/app/App.js b/packages/yoroi-extension/app/App.js index 1708953bc2..19b9294b34 100644 --- a/packages/yoroi-extension/app/App.js +++ b/packages/yoroi-extension/app/App.js @@ -5,24 +5,9 @@ import { observer } from 'mobx-react'; import { Router } from 'react-router-dom'; import type { RouterHistory } from 'react-router-dom'; import { addLocaleData, IntlProvider } from 'react-intl'; -import en from 'react-intl/locale-data/en'; -import ko from 'react-intl/locale-data/ko'; -import ja from 'react-intl/locale-data/ja'; -import zh from 'react-intl/locale-data/zh'; -import ru from 'react-intl/locale-data/ru'; -import de from 'react-intl/locale-data/de'; -import fr from 'react-intl/locale-data/fr'; -import nl from 'react-intl/locale-data/nl'; -import pt from 'react-intl/locale-data/pt'; -import id from 'react-intl/locale-data/id'; -import es from 'react-intl/locale-data/es'; -import it from 'react-intl/locale-data/it'; -import tr from 'react-intl/locale-data/tr'; -import cs from 'react-intl/locale-data/cs'; -import sk from 'react-intl/locale-data/sk'; import { observable, autorun, runInAction } from 'mobx'; import { Routes } from './Routes'; -import { translations } from './i18n/translations'; +import { locales, translations } from './i18n/translations'; import type { StoresMap } from './stores'; import type { ActionsMap } from './actions'; import { changeToplevelTheme, MuiThemes } from './styles/utils'; @@ -39,23 +24,7 @@ import Support from './components/widgets/Support'; import { trackNavigation } from './api/analytics'; // https://github.com/yahoo/react-intl/wiki#loading-locale-data -addLocaleData([ - ...en, - ...ko, - ...ja, - ...zh, - ...ru, - ...de, - ...fr, - ...nl, - ...pt, - ...id, - ...es, - ...it, - ...tr, - ...cs, - ...sk, -]); +addLocaleData(locales); type Props = {| +stores: StoresMap, diff --git a/packages/yoroi-extension/app/assets/images/flags/vietnamese.inline.svg b/packages/yoroi-extension/app/assets/images/flags/vietnamese.inline.svg new file mode 100644 index 0000000000..868caa51ba --- /dev/null +++ b/packages/yoroi-extension/app/assets/images/flags/vietnamese.inline.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/yoroi-extension/app/components/topbar/banners/TestnetWarningBanner.js b/packages/yoroi-extension/app/components/topbar/banners/TestnetWarningBanner.js index cb735ea070..67d80efdba 100644 --- a/packages/yoroi-extension/app/components/topbar/banners/TestnetWarningBanner.js +++ b/packages/yoroi-extension/app/components/topbar/banners/TestnetWarningBanner.js @@ -63,7 +63,9 @@ export default class TestnetWarningBanner extends Component {
- NOTE: Unfortunately the Ergo network support will be dropped from Yoroi in the near future. + NOTE: Due to the planned gradual termination of the Ergo wallets support in Yoroi extension, +
+ Starting with the next version any Ergo wallets in the list will be visible, but not operational!
Please make sure to migrate your Ergo funds and wallets to another application.
diff --git a/packages/yoroi-extension/app/components/topbar/banners/TestnetWarningBanner.scss b/packages/yoroi-extension/app/components/topbar/banners/TestnetWarningBanner.scss index 8b31396cab..7bd2c43f07 100644 --- a/packages/yoroi-extension/app/components/topbar/banners/TestnetWarningBanner.scss +++ b/packages/yoroi-extension/app/components/topbar/banners/TestnetWarningBanner.scss @@ -46,7 +46,7 @@ } .ergoWarning { - height: 60px; + height: 90px; display: flex; justify-content: center; align-items: center; diff --git a/packages/yoroi-extension/app/components/wallet/assets/AssetsList.js b/packages/yoroi-extension/app/components/wallet/assets/AssetsList.js index 70b4f15482..7fec4aa836 100644 --- a/packages/yoroi-extension/app/components/wallet/assets/AssetsList.js +++ b/packages/yoroi-extension/app/components/wallet/assets/AssetsList.js @@ -37,6 +37,7 @@ const SORTING_COLUMNS = { name: string, id: string, amount: string, + amountForSorting?: BigNumber, |} type Props = {| +assetsList: Asset[], @@ -136,6 +137,10 @@ export default class AssetsList extends Component { this.setState({ sortingDirection: newSortDirection }) if (field === 'amount') { + const dedicatedField = 'amountForSorting'; + if (a[dedicatedField] != null && b[dedicatedField] != null) { + return compareNumbers(a[dedicatedField], b[dedicatedField], newSortDirection) + } return compareNumbers(a[field], b[field], newSortDirection) } // Other fields diff --git a/packages/yoroi-extension/app/components/wallet/assets/TokenList.js b/packages/yoroi-extension/app/components/wallet/assets/TokenList.js index accf777f27..61fc2b36fb 100644 --- a/packages/yoroi-extension/app/components/wallet/assets/TokenList.js +++ b/packages/yoroi-extension/app/components/wallet/assets/TokenList.js @@ -33,6 +33,7 @@ import { Link } from 'react-router-dom'; import { ROUTES } from '../../../routes-config'; import CopyToClipboardText from '../../widgets/CopyToClipboardLabel'; import { ListEmpty } from './ListEmpty'; +import BigNumber from 'bignumber.js'; const SORTING_DIRECTIONS = { UP: 'UP', @@ -48,6 +49,7 @@ export type Asset = {| name: string, id: string, amount: string, + amountForSorting?: BigNumber, |}; type Props = {| +assetsList: Asset[], @@ -90,6 +92,10 @@ function TokenList({ assetsList: list, shouldHideBalance, intl }: Props & Intl): setState({ ...state, sortingDirection: newSortDirection }); if (field === SORTING_COLUMNS.AMOUNT) { + const dedicatedField = 'amountForSorting'; + if (a[dedicatedField] != null && b[dedicatedField] != null) { + return compareNumbers(a[dedicatedField], b[dedicatedField], newSortDirection); + } return compareNumbers(a[field], b[field], newSortDirection); } // Other fields diff --git a/packages/yoroi-extension/app/components/widgets/FlagLabel.js b/packages/yoroi-extension/app/components/widgets/FlagLabel.js index dd9aa19f35..29b519ac28 100644 --- a/packages/yoroi-extension/app/components/widgets/FlagLabel.js +++ b/packages/yoroi-extension/app/components/widgets/FlagLabel.js @@ -18,7 +18,7 @@ export default class FlagLabel extends Component { return (
- + { typeof svg === 'string' ? svg : ()} {label}
); diff --git a/packages/yoroi-extension/app/containers/banners/BannerContainer.js b/packages/yoroi-extension/app/containers/banners/BannerContainer.js index 3d9bac311e..0cbc521722 100644 --- a/packages/yoroi-extension/app/containers/banners/BannerContainer.js +++ b/packages/yoroi-extension/app/containers/banners/BannerContainer.js @@ -27,13 +27,11 @@ export default class BannerContainer extends Component isErgo(w.getParent().getNetworkInfo())) ?? false; const deprecationBanner = this.getDeprecationBanner(); return ( @@ -47,7 +45,7 @@ export default class BannerContainer extends Component )} - + {!environment.isProduction() && } {deprecationBanner} @@ -88,7 +86,10 @@ export default class BannerContainer extends Component |}, + wallets: {| + publicDerivers?: Array>, + selected: null | PublicDeriver<>, + |}, |}, actions: {||}, |} { @@ -109,6 +110,7 @@ export default class BannerContainer extends Component - |}, + wallets: { + selected: null | PublicDeriver<>, + ... + }, tokenInfoStore: {| tokenInfo: TokenInfoMap, |}, diff --git a/packages/yoroi-extension/app/containers/wallet/TokensPageRevamp.js b/packages/yoroi-extension/app/containers/wallet/TokensPageRevamp.js index dce3735c75..20d264148a 100644 --- a/packages/yoroi-extension/app/containers/wallet/TokensPageRevamp.js +++ b/packages/yoroi-extension/app/containers/wallet/TokensPageRevamp.js @@ -51,6 +51,7 @@ export default class TokensPageRevamp extends Component10 characters long.", "global.publicKey.explanation": "Public keys allow seeing the wallet history for the wallet, but does not allow to spend or move the funds in any way (private key is not included)", "global.receive": "Receive", @@ -462,11 +463,11 @@ "wallet.add.page.hw.tooltip": "Create or restore a Yoroi wallet
using a Ledger or Trezor hardware wallet.", "wallet.add.page.restore.title": "Restore wallet", "wallet.add.page.restore.tooltip": "Enter a 15-word recovery phrase
to restore an already-existing Yoroi wallet,
or import an existing Yoroi paper wallet.", + "wallet.add.page.revamp.backButtonLabel": "Back to current wallet", "wallet.add.page.revamp.connectHardwareWallet": "Connect hardware wallet", "wallet.add.page.revamp.createWallet": "Create new wallet", "wallet.add.page.revamp.restoreWallet": "Restore existing wallet", "wallet.add.page.revamp.subtitle": "Light wallet for Cardano assets", - "wallet.add.page.revamp.backButtonLabel": "Back to current wallet", "wallet.add.page.subtitle.label": "Yoroi light wallet for Cardano", "wallet.add.page.title": "Your gateway
to the
financial world", "wallet.address.category.addressBook": "Addresses that do not belong to you, but are relevant to your wallet", @@ -1061,4 +1062,4 @@ "yoroiTransfer.waiting.progressInfo.checkingAddresses": "Checking addresses funds", "yoroiTransfer.waiting.progressInfo.restoringAddresses": "Fetching addresses", "yoroiTransfer.waiting.title.label": "Wallet is being restored" -} +} \ No newline at end of file diff --git a/packages/yoroi-extension/app/i18n/translations.js b/packages/yoroi-extension/app/i18n/translations.js index 44622b605f..7fe3be2d5c 100644 --- a/packages/yoroi-extension/app/i18n/translations.js +++ b/packages/yoroi-extension/app/i18n/translations.js @@ -1,4 +1,20 @@ // @flow +import en from 'react-intl/locale-data/en'; +import ko from 'react-intl/locale-data/ko'; +import ja from 'react-intl/locale-data/ja'; +import zh from 'react-intl/locale-data/zh'; +import ru from 'react-intl/locale-data/ru'; +import de from 'react-intl/locale-data/de'; +import fr from 'react-intl/locale-data/fr'; +import nl from 'react-intl/locale-data/nl'; +import pt from 'react-intl/locale-data/pt'; +import id from 'react-intl/locale-data/id'; +import es from 'react-intl/locale-data/es'; +import it from 'react-intl/locale-data/it'; +import tr from 'react-intl/locale-data/tr'; +import cs from 'react-intl/locale-data/cs'; +import sk from 'react-intl/locale-data/sk'; +import vi from 'react-intl/locale-data/vi'; import globalMessages from './global-messages'; import type { $npm$ReactIntl$MessageDescriptor } from 'react-intl'; import { ReactComponent as EnglishFlag } from '../assets/images/flags/english.inline.svg'; @@ -16,9 +32,28 @@ import { ReactComponent as IndonesianFlag } from '../assets/images/flags/indone import { ReactComponent as TurkishFlag } from '../assets/images/flags/turkish.inline.svg'; import { ReactComponent as CzechFlag } from '../assets/images/flags/czech.inline.svg'; import { ReactComponent as SlovakFlag } from '../assets/images/flags/slovak.inline.svg'; +import { ReactComponent as VietnameseFlag } from '../assets/images/flags/vietnamese.inline.svg'; -// This is essentially bulk require +export const locales: any = Object.freeze([ + ...en, + ...ko, + ...ja, + ...zh, + ...ru, + ...de, + ...fr, + ...nl, + ...pt, + ...id, + ...es, + ...it, + ...tr, + ...cs, + ...sk, + ...vi, +]); +// This is essentially bulk require // $FlowExpectedError[prop-missing] require.context comes from webpack const req = require.context('./locales', true, /\.json.*$/, 'lazy'); export const translations: {| @@ -116,5 +151,10 @@ export const LANGUAGES: Array = [ value: 'sk-SK', label: globalMessages.languageSlovak, svg: SlovakFlag + }, + { + value: 'vi-VN', + label: globalMessages.languageVietnamese, + svg: VietnameseFlag } ]; diff --git a/packages/yoroi-extension/package-lock.json b/packages/yoroi-extension/package-lock.json index 7f9e1d395b..2803c7f99c 100644 --- a/packages/yoroi-extension/package-lock.json +++ b/packages/yoroi-extension/package-lock.json @@ -1,6 +1,6 @@ { "name": "yoroi", - "version": "4.21.0", + "version": "4.22.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/yoroi-extension/package.json b/packages/yoroi-extension/package.json index 4f06b6a86e..a37a154615 100644 --- a/packages/yoroi-extension/package.json +++ b/packages/yoroi-extension/package.json @@ -1,6 +1,6 @@ { "name": "yoroi", - "version": "4.21.0", + "version": "4.22.0", "description": "Cardano ADA wallet", "scripts": { "dev:build": "rimraf dev/ && babel-node scripts/build --type=debug", diff --git a/packages/yoroi-extension/webpack/prodConfig.js b/packages/yoroi-extension/webpack/prodConfig.js index f6b1fb62bf..9dbb0ecdce 100644 --- a/packages/yoroi-extension/webpack/prodConfig.js +++ b/packages/yoroi-extension/webpack/prodConfig.js @@ -42,8 +42,8 @@ const baseProdConfig = (env /*: EnvParams */) /*: * */ => ({ }, output: { path: path.join(__dirname, '../build/js'), - filename: '[name].bundle.js', - chunkFilename: '[name].chunk.js', + filename: '[name].[contenthash].bundle.js', + chunkFilename: '[name].[contenthash].chunk.js', publicPath: env.publicPath == null ? defaultPublicPath : env.publicPath, }, plugins: [