Skip to content

Commit 392374b

Browse files
authored
refactor: clean up onboarding and imports (#116)
1 parent 8119cfb commit 392374b

File tree

5 files changed

+36
-28
lines changed

5 files changed

+36
-28
lines changed

src/assets/panda-logo-wide.png

17.3 KB
Loading

src/hooks/useKeys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export type WifKeys = {
3030
ordPk: string;
3131
};
3232

33-
export type SupportedWalletImports = 'relayx' | 'twetch' | 'aym';
33+
export type SupportedWalletImports = 'relayx' | 'twetch' | 'aym' | 'panda' | 'wif';
3434

3535
export const useKeys = () => {
3636
const [bsvAddress, setBsvAddress] = useState('');

src/pages/onboarding/CreateWallet.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import styled from 'styled-components';
2-
import { ColorThemeProps } from '../../theme';
3-
import { useNavigate } from 'react-router-dom';
41
import { useEffect, useState } from 'react';
5-
import { useSnackbar } from '../../hooks/useSnackbar';
2+
import { useNavigate } from 'react-router-dom';
3+
import styled from 'styled-components';
64
import { BackButton } from '../../components/BackButton';
7-
import { Text, HeaderText } from '../../components/Reusable';
8-
import { Input } from '../../components/Input';
95
import { Button } from '../../components/Button';
10-
import { PandaHead } from '../../components/PandaHead';
11-
import { useKeys } from '../../hooks/useKeys';
12-
import { useBottomMenu } from '../../hooks/useBottomMenu';
6+
import { Input } from '../../components/Input';
137
import { PageLoader } from '../../components/PageLoader';
8+
import { PandaHead } from '../../components/PandaHead';
9+
import { HeaderText, Text } from '../../components/Reusable';
1410
import { Show } from '../../components/Show';
15-
import { sleep } from '../../utils/sleep';
11+
import { useBottomMenu } from '../../hooks/useBottomMenu';
12+
import { useKeys } from '../../hooks/useKeys';
13+
import { useSnackbar } from '../../hooks/useSnackbar';
1614
import { useTheme } from '../../hooks/useTheme';
15+
import { ColorThemeProps } from '../../theme';
16+
import { sleep } from '../../utils/sleep';
1717

1818
const Content = styled.div`
1919
display: flex;
@@ -107,7 +107,9 @@ export const CreateWallet = () => {
107107
<BackButton onClick={() => navigate('/')} />
108108
<Content>
109109
<HeaderText theme={theme}>Create a password</HeaderText>
110-
<Text theme={theme}>This is used to unlock your wallet.</Text>
110+
<Text style={{ marginBottom: '1rem' }} theme={theme}>
111+
This is used to unlock your wallet.
112+
</Text>
111113
<FormContainer onSubmit={handleKeyGeneration}>
112114
<Input
113115
theme={theme}
@@ -123,7 +125,7 @@ export const CreateWallet = () => {
123125
value={passwordConfirm}
124126
onChange={(e) => setPasswordConfirm(e.target.value)}
125127
/>
126-
<Text theme={theme} style={{ margin: '3rem 0 1rem' }}>
128+
<Text theme={theme} style={{ margin: '1rem 0 1rem' }}>
127129
Make sure you are in a safe place and no one is watching.
128130
</Text>
129131
<Button theme={theme} type="primary" label="Generate Seed" isSubmit />

src/pages/onboarding/RestoreWallet.tsx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
22
import { useNavigate } from 'react-router-dom';
33
import styled from 'styled-components';
44
import aymLogo from '../../assets/aym-logo.png';
5+
import pandaLogoWide from '../../assets/panda-logo-wide.png';
56
import relayXLogo from '../../assets/relayx-logo.png';
67
import twetchLogo from '../../assets/twetch-logo.png';
78
import { BackButton } from '../../components/BackButton';
@@ -65,8 +66,8 @@ const ExpertImportWrapper = styled.div`
6566
const WalletText = styled(Text)<ColorThemeProps>`
6667
color: ${({ theme }) => theme.white};
6768
margin: 0;
68-
font-weight: 700;
69-
font-size: 1.1rem;
69+
font-weight: 600;
70+
font-size: 1rem;
7071
text-align: center;
7172
`;
7273

@@ -137,11 +138,17 @@ export const RestoreWallet = () => {
137138

138139
const handleWalletSelection = (wallet?: SupportedWalletImports) => {
139140
setImportWallet(wallet);
141+
if (wallet === 'wif') {
142+
navigate('/import-wallet');
143+
return;
144+
}
140145
setStep(2);
141146
};
142147

143148
const getRestoreTitle = () => {
144-
return importWallet === 'relayx'
149+
return importWallet === 'panda'
150+
? 'Restore Panda Wallet'
151+
: importWallet === 'relayx'
145152
? 'Restore Relay Wallet'
146153
: importWallet === 'twetch'
147154
? 'Restore Twetch Wallet'
@@ -249,18 +256,24 @@ export const RestoreWallet = () => {
249256
onClick={() => handleWalletSelection(wallet)}
250257
element={
251258
<>
259+
<Show when={wallet === 'panda'}>
260+
<WalletLogo src={pandaLogoWide} style={{ height: '2.25rem' }} />
261+
</Show>
252262
<Show when={wallet === 'relayx'}>
253-
<WalletLogo src={relayXLogo} />
263+
<WalletLogo src={relayXLogo} style={{ height: '1,75rem' }} />
254264
</Show>
255265
<Show when={wallet === 'twetch'}>
256-
<WalletLogo src={twetchLogo} />
266+
<WalletLogo src={twetchLogo} style={{ height: '1.25rem' }} />
257267
</Show>
258268
<Show when={wallet === 'aym'}>
259269
<WalletLogo src={aymLogo} style={{ height: '2rem' }} />
260270
</Show>
261271
<Show when={!wallet}>
262272
<WalletText theme={theme}>Other Wallet</WalletText>
263273
</Show>
274+
<Show when={wallet === 'wif'}>
275+
<WalletText theme={theme}>WIF (1Sat, SHUA, etc)</WalletText>
276+
</Show>
264277
</>
265278
}
266279
/>
@@ -272,11 +285,11 @@ export const RestoreWallet = () => {
272285
<>
273286
<BackButton onClick={() => navigate('/')} />
274287
<Content>
275-
<HeaderText theme={theme}>Restore from Wallet</HeaderText>
288+
<HeaderText theme={theme}>Restore a Wallet</HeaderText>
276289
<Text theme={theme} style={{ marginBottom: '1rem', width: '90%' }}>
277-
Select from a wallet you'd like to restore from.
290+
Select the wallet you'd like to restore from
278291
</Text>
279-
{availableWallets(['relayx', 'twetch', 'aym', undefined])}
292+
{availableWallets(['panda', 'relayx', 'twetch', 'aym', undefined, 'wif'])}
280293
</Content>
281294
</>
282295
);

src/pages/onboarding/Start.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,6 @@ export const Start = () => {
7171
</Text>
7272
<Button theme={theme} type="primary" label="Create New Wallet" onClick={() => navigate('/create-wallet')} />
7373
<Button theme={theme} type="secondary" label="Restore Wallet" onClick={() => navigate('/restore-wallet')} />
74-
<Button
75-
theme={theme}
76-
type="secondary"
77-
label="Import"
78-
onClick={() => navigate('/import-wallet')}
79-
style={{ margin: '0' }}
80-
/>
8174
<GithubIcon
8275
src={gihubIcon}
8376
onClick={() => window.open('https://github.com/Panda-Wallet/panda-wallet', '_blank')}

0 commit comments

Comments
 (0)