Skip to content

Commit ae969da

Browse files
authored
feat: add warning to btc onboarding re:inscriptions (#1922)
1 parent a811f65 commit ae969da

File tree

5 files changed

+30
-4
lines changed

5 files changed

+30
-4
lines changed

apps/browser-extension-wallet/src/views/bitcoin-mode/features/multi-wallet/Home.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ export const Home = (): JSX.Element => {
5858
)
5959
}}
6060
/>
61-
)
61+
),
62+
infoMessage: translate('core.walletSetupOptionsStep.infoMessage')
6263
};
6364

6465
return (
@@ -77,6 +78,7 @@ export const Home = (): JSX.Element => {
7778
}}
7879
translations={walletSetupOptionsStepTranslations}
7980
withHardwareWallet={false}
81+
withInfoMessage
8082
/>
8183
);
8284
};

apps/browser-extension-wallet/src/views/bitcoin-mode/features/multi-wallet/MultiWallet.module.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ $container-width: 840px;
2525
:global(.ant-modal-close-x) {
2626
display: none;
2727
}
28+
29+
&.flex {
30+
:global(.ant-modal-content) {
31+
min-height: fit-content;
32+
}
33+
34+
:global(.ant-modal-body) {
35+
height: auto;
36+
}
37+
}
2838
}
2939

3040
.container {

apps/browser-extension-wallet/src/views/bitcoin-mode/features/multi-wallet/MultiWallet.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/* eslint-disable unicorn/no-null */
22
import { NavigationButton } from '@lace/common';
3+
import cn from 'classnames';
34
import { WalletSetupConfirmationDialogProvider, WalletSetupFlow, WalletSetupFlowProvider } from '@lace/core';
45
import { useBackgroundPage } from '@providers/BackgroundPageProvider';
56
import { walletRoutePaths } from '@routes';
67
import { Modal } from 'antd';
78
import React, { useCallback } from 'react';
8-
import { useHistory } from 'react-router-dom';
9+
import { useHistory, useLocation } from 'react-router-dom';
910
import styles from './MultiWallet.module.scss';
1011
import { WalletOnboardingFlows } from './WalletOnboardingFlows';
1112
import { postHogMultiWalletActions } from '@providers/AnalyticsProvider/analyticsTracker';
@@ -14,6 +15,7 @@ import { usePostHogClientContext } from '@providers/PostHogClientProvider';
1415

1516
export const MultiWallet = (): JSX.Element => {
1617
const history = useHistory();
18+
const location = useLocation();
1719
const posthogClient = usePostHogClientContext();
1820
const { page, setBackgroundPage } = useBackgroundPage();
1921

@@ -28,6 +30,8 @@ export const MultiWallet = (): JSX.Element => {
2830
[history, page, setBackgroundPage]
2931
);
3032

33+
const isBitcoinModeRootPath = location.pathname === walletRoutePaths.newBitcoinWallet.root;
34+
3135
return (
3236
<WalletSetupFlowProvider flow={WalletSetupFlow.ADD_WALLET}>
3337
<WalletSetupConfirmationDialogProvider>
@@ -38,7 +42,7 @@ export const MultiWallet = (): JSX.Element => {
3842
footer={null}
3943
open={!isDialogOpen}
4044
width="100%"
41-
className={styles.modal}
45+
className={cn(styles.modal, { [styles.flex]: isBitcoinModeRootPath })}
4246
onCancel={() => handleOnCancel(withConfirmationDialog)}
4347
>
4448
<div className={styles.closeButton}>

packages/core/src/ui/components/WalletSetup/WalletSetupOptionsStep.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ReactComponent as HardwareWalletDisabledIcon } from '../../assets/icons
77
import { ReactComponent as RestoreWalletIcon } from '../../assets/icons/onboarding/restore-wallet.component.svg';
88
import { WalletSetupOption } from './WalletSetupOption';
99
import { TranslationsFor } from '@ui/utils/types';
10+
import { Box, InfoBar, InfoComponent } from '@input-output-hk/lace-ui-toolkit';
1011

1112
type SetupOptionTranslations = TranslationsFor<'title' | 'description' | 'button'>;
1213

@@ -21,7 +22,9 @@ export interface WalletSetupOptionsStepProps {
2122
hardwareWallet: SetupOptionTranslations & TranslationsFor<'tooltip'>;
2223
restoreWallet: SetupOptionTranslations;
2324
agreementText: ReactNode;
25+
infoMessage?: string;
2426
};
27+
withInfoMessage?: boolean;
2528
withAgreement?: boolean;
2629
withHardwareWallet?: boolean;
2730
}
@@ -34,7 +37,8 @@ export const WalletSetupOptionsStep = ({
3437
onRestoreWalletRequest,
3538
translations,
3639
withAgreement,
37-
withHardwareWallet
40+
withHardwareWallet,
41+
withInfoMessage
3842
}: WalletSetupOptionsStepProps): React.ReactElement => (
3943
<div className={styles.walletSetupOptionsStep} data-testid="wallet-setup-options-container">
4044
<div className={styles.content} data-testid="wallet-setup-options-content">
@@ -75,6 +79,11 @@ export const WalletSetupOptionsStep = ({
7579
/>
7680
</div>
7781
</div>
82+
{withInfoMessage && (
83+
<Box mt="$32">
84+
<InfoBar icon={<InfoComponent />} message={translations.infoMessage} />
85+
</Box>
86+
)}
7887
{withAgreement && (
7988
<div className={styles.legal} data-testid="agreement-text">
8089
{translations.agreementText}

packages/translation/src/lib/translations/core/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@
617617
"core.walletSetupOptionsStep.restoreWallet.title": "Restore wallet",
618618
"core.walletSetupOptionsStep.subTitle": "Choose an option to get started",
619619
"core.walletSetupOptionsStep.agreementText": "By clicking the Create, Connect or Restore button above, you agree with Lace’s <a1>Terms of Service</a1> and <a2>Privacy Policy</a2>",
620+
"core.walletSetupOptionsStep.infoMessage": "Do not import Bitcoin accounts that contain inscriptions (such as Ordinals or Runes) or receive inscriptions in an account created within Lace. Lace currently does not support inscriptions, and ignoring this advice may result in loss of assets.",
620621
"core.walletSetupOptionsStep.title": "Let's explore Web3 together",
621622
"core.walletSetupRecoveryPhraseLengthStep.description": "Choose your recovery phrase length of either 12, 15 or 24 words to restore your wallet.",
622623
"core.walletSetupRecoveryPhraseLengthStep.title": "Recovery phrase length",

0 commit comments

Comments
 (0)