Skip to content

Commit 9d7abeb

Browse files
committed
fix: importing mnemonics immediately after resetting wallet
1 parent 7f60a48 commit 9d7abeb

3 files changed

Lines changed: 33 additions & 13 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "side-wallet",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"private": true,
55
"scripts": {
66
"clean": "mkdir -p dist && rm -rf dist/* && cp -r build/_raw/* dist",

src/ui/pages/Account/CreateHDWalletScreen/index.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { useCallback, useMemo, useState } from 'react';
22
import { useLocation } from 'react-router-dom';
33

44
import { AddressType, RestoreWalletType } from '@/shared/types';
5-
import { Column, Header, Layout, StepBar } from '@/ui/components';
5+
import { Column, Header, StepBar } from '@/ui/components';
6+
import { useExtensionIsInTab } from '@/ui/features/browser/tabs';
67

78
import { useNavigate } from '../../MainRoute';
89
import Step1_Create from './Step1_Create';
@@ -13,6 +14,7 @@ import { ContextData, TabType, UpdateContextDataParams, WordsType } from './type
1314

1415
export default function CreateHDWalletScreen() {
1516
const navigate = useNavigate();
17+
const isInTab = useExtensionIsInTab();
1618

1719
const { state } = useLocation();
1820
const { isImport, fromUnlock } = state as {
@@ -90,13 +92,20 @@ export default function CreateHDWalletScreen() {
9092
}, [items, contextData.tabType]);
9193

9294
return (
93-
<Layout
95+
<div
9496
style={{
97+
backgroundColor: '#09090A',
98+
display: 'flex',
99+
flexDirection: 'column',
100+
width: '100%',
95101
maxWidth: window.location.pathname === '/sidePanel.html' ? '100vw' : '375px',
102+
minHeight: '600px',
96103
height: window.location.pathname === '/sidePanel.html' ? '100vh' : '600px',
97-
overflowY: 'hidden'
98-
}}
99-
>
104+
overflowY: 'auto',
105+
overflowX: 'hidden',
106+
border: !isInTab ? '1px solid rgba(255, 255, 255, 0.1)' : 'none',
107+
justifyContent: 'center'
108+
}}>
100109
<Header
101110
onBack={() => {
102111
if (fromUnlock) {
@@ -112,8 +121,7 @@ export default function CreateHDWalletScreen() {
112121
padding: '0 16px 0',
113122
marginTop: '10px',
114123
marginBottom: '10px'
115-
}}
116-
>
124+
}}>
117125
<StepBar
118126
activeKey={contextData.tabType}
119127
items={items.map((v) => ({
@@ -123,6 +131,6 @@ export default function CreateHDWalletScreen() {
123131
/>
124132
</Column>
125133
{currentChildren}
126-
</Layout>
134+
</div>
127135
);
128136
}

src/ui/pages/Account/CreatePasswordScreen.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { Checkbox } from 'antd';
22
import { useEffect, useMemo, useState } from 'react';
33
import { useLocation, useNavigate as useNavigateRouter } from 'react-router-dom';
44

5-
import { Button, Column, Header, Input, Layout, Row, Text } from '@/ui/components';
5+
import { Button, Column, Header, Input, Row, Text } from '@/ui/components';
66
import { useTools } from '@/ui/components/ActionComponent';
7+
import { useExtensionIsInTab } from '@/ui/features/browser/tabs';
78
import { useWallet, useWalletRequest } from '@/ui/utils';
89
import { getPasswordStrengthWord } from '@/ui/utils/password-utils';
910

@@ -14,6 +15,7 @@ type Status = '' | 'error' | 'warning' | undefined;
1415
export default function CreatePasswordScreen() {
1516
const navigate = useNavigate();
1617
const navigateRouter = useNavigateRouter();
18+
const isInTab = useExtensionIsInTab();
1719
const wallet = useWallet();
1820
const loc = useLocation();
1921
const params = new URLSearchParams(loc.search);
@@ -118,9 +120,19 @@ export default function CreatePasswordScreen() {
118120
};
119121

120122
return (
121-
<Layout
123+
<div
122124
style={{
123-
maxWidth: window.location.pathname === '/sidePanel.html' ? '100vw' : '375px'
125+
backgroundColor: '#09090A',
126+
display: 'flex',
127+
flexDirection: 'column',
128+
width: '100%',
129+
maxWidth: window.location.pathname === '/sidePanel.html' ? '100vw' : '375px',
130+
minHeight: '600px',
131+
height: window.location.pathname === '/sidePanel.html' ? '100vh' : '600px',
132+
overflowY: 'auto',
133+
overflowX: 'hidden',
134+
border: !isInTab ? '1px solid rgba(255, 255, 255, 0.1)' : 'none',
135+
justifyContent: 'center'
124136
}}>
125137
<Header onBack={() => navigateRouter(-1)} title="Create Password"></Header>
126138
<Column
@@ -252,6 +264,6 @@ export default function CreatePasswordScreen() {
252264
</Column>
253265
<Button disabled={disabled} text="Next" preset="primary" onClick={btnClick} />
254266
</Column>
255-
</Layout>
267+
</div>
256268
);
257269
}

0 commit comments

Comments
 (0)