View on GitHub
File Changes
  children?: ?Node,
  activeWallet?: ?Wallet,
  onTransferFunds?: Function,
+
  onWalletAdd?: Function,
+
  hasAnyWallets?: boolean,
};

                      
@observer
      activeWallet,
      children,
      onTransferFunds,
+
      hasAnyWallets,
+
      onWalletAdd,
    } = this.props;

                      
    const topBarStyles = classNames([
      activeWallet &&
      activeWallet.isLegacy &&
      activeWallet.amount > 0 &&
-
      onTransferFunds;
+
      ((hasAnyWallets && onTransferFunds) || onWalletAdd);

                      
    const topBarTitle = activeWallet ? (
      <span className={styles.walletInfo}>
          <LegacyNotification
            onLearnMore={() => null}
            onTransferFunds={() => onTransferFunds(activeWallet.id)}
+
            hasAnyWallets={hasAnyWallets}
+
            onWalletAdd={onWalletAdd}
          />
        )}
      </header>
    defaultMessage: '!!!Move all of the ada from this wallet',
    description: 'Move all ada action of legacy notification.',
  },
+
  addWallet: {
+
    id: 'wallet.legacy.notification.addWallet',
+
    defaultMessage: '!!!Move all of the ada from this wallet',
+
    description: 'Add wallet action of legacy notification.',
+
  },
});

                      
type Props = {
  onLearnMore: Function,
  onTransferFunds: Function,
+
  hasAnyWallets?: boolean,
+
  onWalletAdd?: boolean,
};

                      
@observer

                      
  render() {
    const { intl } = this.context;
-
    const { onLearnMore, onTransferFunds } = this.props;
+
    const {
+
      onLearnMore,
+
      onTransferFunds,
+
      hasAnyWallets,
+
      onWalletAdd,
+
    } = this.props;
    const title = intl.formatMessage(messages.title);
    const description = intl.formatMessage(messages.description);
    const actionLearnMore = intl.formatMessage(messages.actionLearnMore);
-
    const actionMove = intl.formatMessage(messages.actionMove);
+

                      
+
    const buttonLabel = hasAnyWallets
+
      ? intl.formatMessage(messages.actionMove)
+
      : intl.formatMessage(messages.addWallet);
+

                      
+
    const buttonAction = hasAnyWallets ? onTransferFunds : onWalletAdd;

                      
    return (
      <div className={styles.component}>
            onClick={onLearnMore}
            skin={ButtonSkin}
          />
-
          <Button
-
            className={styles.actionMove}
-
            label={actionMove}
-
            onClick={onTransferFunds}
-
            skin={ButtonSkin}
-
          />
+
          {
+
            <Button
+
              className={styles.actionMove}
+
              label={buttonLabel}
+
              onClick={buttonAction}
+
              skin={ButtonSkin}
+
            />
+
          }
        </div>
      </div>
    );
import TopBar from '../components/layout/TopBar';
import NodeSyncStatusIcon from '../components/widgets/NodeSyncStatusIcon';
import NewsFeedIcon from '../components/widgets/NewsFeedIcon';
+
import WalletCreateDialog from '../components/wallet/WalletCreateDialog';
import WalletTestEnvironmentLabel from '../components/widgets/WalletTestEnvironmentLabel';
import type { InjectedProps } from '../types/injectedPropsType';
import menuIconOpened from '../assets/images/menu-opened-ic.inline.svg';
      <WalletTestEnvironmentLabel network={network} />
    ) : null;

                      
+
    const onWalletAdd = actions.router.goToRoute.trigger({
+
      route: ROUTES.WALLETS.ADD,
+
    });
+

                      
    const onTransferFunds = (sourceWalletId: string) =>
      actions.wallets.transferFundsSetSourceWalletId.trigger({
        sourceWalletId,
        onLeftIconClick={actions.sidebar.toggleSubMenus.trigger}
        activeWallet={activeWallet}
        onTransferFunds={onTransferFunds}
+
        hasAnyWallets={hasAnyWallets}
+
        onWalletAdd={onWalletAdd}
      >
        {testnetLabel}
        <NodeSyncStatusIcon networkStatus={networkStatus} />
      environment: { isMainnet, isTestnet },
    } = app;

                      
-
    const walletCreationAction = useNewWalletCreationProcess
+
    const onWalletAdd = useNewWalletCreationProcess
      ? () => actions.wallets.createWalletBegin.trigger()
      : // TODO: Remove once the new wallet creation process is ready
        () => actions.dialogs.open.trigger({ dialog: WalletCreateDialog });
        <WalletAdd
          isMainnet={isMainnet}
          isTestnet={isTestnet}
-
          onCreate={walletCreationAction}
+
          onCreate={onWalletAdd}
          onRestore={() =>
            actions.dialogs.open.trigger({ dialog: WalletRestoreDialog })
          }
  "wallet.legacy.badge.label": "Legacy",
  "wallet.legacy.notification.actionLearnMore": "Learn more",
  "wallet.legacy.notification.actionMove": "Move all of the ada from this wallet",
+
  "wallet.legacy.notification.addWallet": "Add wallet",
  "wallet.legacy.notification.description": "This is a legacy wallet which uses legacy addresses and does not support new features. Please move all of the ada from this legacy wallet to one of the wallets where new features are available. You can also create a brand new wallet for your ada in case you don’t want to move ada to one of your existing wallets. A sequence of screens will guide you through the process.",
  "wallet.legacy.notification.title": "Move funds from the legacy wallet",
  "wallet.navigation.more": "More",
  "wallet.transferFunds.dialog2.passphraseFieldPlaceholder": "Type your spending password",
  "wallet.transferFunds.dialog2.passphraseLabel": "Spending password",
  "wallet.transferFunds.dialog2.title": "Transfer funds from the legacy wallet"
-
}
\ No newline at end of file
+
}
  "wallet.legacy.badge.label": "旧",
  "wallet.legacy.notification.actionLearnMore": "もっと知る",
  "wallet.legacy.notification.actionMove": "すべてのADAをこのウォレットから移す",
+
  "wallet.legacy.notification.addWallet": "ウォレットを追加",
  "wallet.legacy.notification.description": "これは旧アドレスを使用している旧タイプのウォレットであり、新機能をサポートしていません。 このウォレットに含まれるすべてのADAを、新機能の使用が可能な新タイプのウォレットに移してください。既存のウォレットへ移動させたくない場合は、新規にウォレットを作成することもできます。画面の指示に従って手続きをしてください。",
  "wallet.legacy.notification.title": "旧ウォレットから資金を移してください",
  "wallet.navigation.more": "その他",
  "wallet.transferFunds.dialog2.passphraseFieldPlaceholder": "送信時パスワードを入力してください",
  "wallet.transferFunds.dialog2.passphraseLabel": "送信時パスワード",
  "wallet.transferFunds.dialog2.title": "旧ウォレットから資金を移し替える"
-
}
\ No newline at end of file
+
}
import { observer, inject } from 'mobx-react';
import { get } from 'lodash';
import { action } from '@storybook/addon-actions';
+
import { boolean } from '@storybook/addon-knobs';

                      
// Assets and helpers
import { CATEGORIES_BY_NAME } from '../../../source/renderer/app/config/sidebarConfig';
      showSubMenus={this.isShowingSubMenus}
      leftIcon={this.isShowingSubMenus ? menuIconOpened : menuIconClosed}
      onTransferFunds={action('onTransferFunds')}
+
      onWalletAdd={action('onWalletAdd')}
+
      hasAnyWallets={boolean('hasAnyWallets', true)}
    >
      <NodeSyncStatusIcon
        networkStatus={{