From 6a0ff84b18de8d93c443bd5d3172275084ac6613 Mon Sep 17 00:00:00 2001 From: Nikola Glumac Date: Mon, 3 Aug 2020 14:24:27 +0200 Subject: [PATCH] [DDW-336] Disabled wallet creation before the Shelley HF (#2126) --- CHANGELOG.md | 4 ++++ source/renderer/app/components/wallet/WalletAdd.js | 7 ++++++- source/renderer/app/containers/wallet/WalletAddPage.js | 6 +++--- storybook/stories/wallets/addWallet/Add.stories.js | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fe9ff1e5f..88b35a6b5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Changelog ## vNext +### Features + +- Disabled creating Byron wallets ([PR 2126](https://github.com/input-output-hk/daedalus/pull/2126)) + ### Fixes - Fixed Daedalus logo animation on the "Loading" screen ([PR 2124](https://github.com/input-output-hk/daedalus/pull/2124)) diff --git a/source/renderer/app/components/wallet/WalletAdd.js b/source/renderer/app/components/wallet/WalletAdd.js index 4e954cf189..918672c959 100644 --- a/source/renderer/app/components/wallet/WalletAdd.js +++ b/source/renderer/app/components/wallet/WalletAdd.js @@ -100,6 +100,7 @@ type Props = { isMainnet: boolean, isTestnet: boolean, isProduction: boolean, + isShelleyActivated: boolean, }; @observer @@ -123,6 +124,7 @@ export default class WalletAdd extends Component { isMainnet, isTestnet, isProduction, + isShelleyActivated, } = this.props; const componentClasses = classnames([styles.component, 'WalletAdd']); @@ -146,7 +148,10 @@ export default class WalletAdd extends Component { ? intl.formatMessage(messages.createDescriptionItn) : intl.formatMessage(messages.createDescription) } - isDisabled={isMaxNumberOfWalletsReached} + isDisabled={ + isMaxNumberOfWalletsReached || + (!isIncentivizedTestnet && !isShelleyActivated) + } /> { render() { const { actions, stores } = this.props; - const { wallets, walletMigration, uiDialogs } = stores; + const { networkStatus, wallets, walletMigration, uiDialogs } = stores; const { createWalletStep, createWalletUseNewProcess, @@ -39,9 +39,8 @@ export default class WalletAddPage extends Component { restoreWalletUseNewProcess, environment, } = wallets; - + const { isShelleyActivated } = networkStatus; const { walletMigrationStep } = walletMigration; - const { isMainnet, isTestnet, isProduction } = environment; const onCreateWallet = createWalletUseNewProcess @@ -84,6 +83,7 @@ export default class WalletAddPage extends Component { isMainnet={isMainnet} isTestnet={isTestnet} isProduction={isProduction} + isShelleyActivated={isShelleyActivated} /> {activeDialog} diff --git a/storybook/stories/wallets/addWallet/Add.stories.js b/storybook/stories/wallets/addWallet/Add.stories.js index bff7b200e1..142e7b4e86 100644 --- a/storybook/stories/wallets/addWallet/Add.stories.js +++ b/storybook/stories/wallets/addWallet/Add.stories.js @@ -26,6 +26,7 @@ storiesOf('Wallets|Add Wallet', module) onImport={() => {}} isMainnet={boolean('isMainnet', true)} isTestnet={boolean('isTestnet', false)} + isShelleyActivated={boolean('isShelleyActivated', true)} isProduction isIncentivizedTestnet={isIncentivizedTestnetTheme(props.currentTheme)} isMaxNumberOfWalletsReached={boolean(