Skip to content

Commit c3911b7

Browse files
committed
feat(extension-chrome): modify code after code review
1 parent 6f3417f commit c3911b7

File tree

15 files changed

+46
-67
lines changed

15 files changed

+46
-67
lines changed

packages/extension-chrome/src/pages/Components/ProgressLine.tsx renamed to packages/extension-chrome/src/pages/Components/ProgressIndicator.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React, { FC } from 'react';
44

55
export type ProgressIndicatorProps = { total: number; current: number } & BoxProps;
66

7-
export const ProcessIndicator: FC<ProgressIndicatorProps> = ({ total, current }) => {
7+
export const ProgressIndicator: FC<ProgressIndicatorProps> = ({ total, current, ...rest }) => {
88
const getIndicatorColor = (index: number) => {
99
if (index < current) {
1010
return 'primary.lighter';
@@ -24,6 +24,7 @@ export const ProcessIndicator: FC<ProgressIndicatorProps> = ({ total, current })
2424
h="5px"
2525
borderRadius="5px"
2626
backgroundColor={getIndicatorColor(index)}
27+
{...rest}
2728
/>
2829
))}
2930
</HStack>

packages/extension-chrome/src/pages/Components/ProgressSteps.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const renderSingleStep: StepsProps['itemRender'] = ({ title, description, status
2323
border: 'none',
2424
},
2525
}}
26+
transitionDuration="common"
27+
transitionProperty="opacity"
2628
opacity={status === 'wait' ? 0.7 : 1}
2729
color="white"
2830
templateRows="auto"
@@ -43,6 +45,9 @@ const renderSingleStep: StepsProps['itemRender'] = ({ title, description, status
4345
border="1px solid white"
4446
borderRadius="2px"
4547
my="1px"
48+
transitionDuration="common"
49+
transitionProperty="opacity"
50+
opacity={status === 'finish' ? 1 : 0.7}
4651
/>
4752
<Text as={Box} lineHeight="4" ml="8px" fontSize="sm">
4853
{description}

packages/extension-chrome/src/pages/Components/SearchBar.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import { SearchIcon } from '@chakra-ui/icons';
22
import { Center, Input, InputGroup, InputGroupProps, InputLeftElement, InputProps } from '@chakra-ui/react';
33
import React, { FC } from 'react';
44

5-
type InputPickedFields = 'onChange' | 'onBlur' | 'onFocus' | 'onClick' | 'value' | 'defaultValue';
5+
type InputPickedFields = 'onChange' | 'onBlur' | 'onFocus' | 'value' | 'defaultValue';
66

77
type SearchBarProps = Omit<InputGroupProps, InputPickedFields> & Pick<InputProps, InputPickedFields>;
88

9-
export const SearchBar: FC<SearchBarProps> = ({ onChange, onBlur, onFocus, onClick, value, defaultValue, ...rest }) => (
9+
export const SearchBar: FC<SearchBarProps> = ({ onChange, onBlur, onFocus, value, defaultValue, ...rest }) => (
1010
<InputGroup w="100%" {...rest}>
1111
<InputLeftElement h="100%" px="8px" w="60px">
1212
<Center w="40px" h="40px" bg="white.300" borderRadius="8px">
@@ -28,7 +28,6 @@ export const SearchBar: FC<SearchBarProps> = ({ onChange, onBlur, onFocus, onCli
2828
onChange={onChange}
2929
onBlur={onBlur}
3030
onFocus={onFocus}
31-
onClick={onClick}
3231
value={value}
3332
defaultValue={defaultValue}
3433
/>

packages/extension-chrome/src/pages/Notification/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ const router = createHashRouter(routes);
6262

6363
const App = () => {
6464
return (
65-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
6665
<ChakraProvider theme={solidBackgroundTheme}>
6766
<QueryClientProvider client={queryClient}>
6867
<RouterProvider router={router} />

packages/extension-chrome/src/pages/Popup/containers/Network/NetworkConfig.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ export const NetworkConfig: FC = () => {
115115
</Flex>
116116
))}
117117
</RadioGroup>
118-
{/* </WhiteAlphaBox> */}
119118
<Spacer />
120119
<Button
121120
data-test-id="addNetwork"

packages/extension-chrome/src/pages/Popup/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ const App: FC = () => {
8282

8383
return (
8484
<React.StrictMode>
85-
{/* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */}
8685
<ChakraProvider theme={solidBackgroundTheme}>
8786
<QueryClientProvider client={queryClient}>
8887
<RouterProvider router={hashRouter} />
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { FC } from 'react';
2-
import { Card, ListItem, Heading, Text, UnorderedList, ListIcon, Button, Center } from '@chakra-ui/react';
2+
import { Card, ListItem, Heading, Text, UnorderedList, ListIcon, Button, Center, Box } from '@chakra-ui/react';
33
import { useNavigate } from 'react-router-dom';
44
import { CircleMarker } from '../../Components/CircleMarker';
55

@@ -12,14 +12,12 @@ const texts = [
1212
export const BeforeStart: FC = () => {
1313
const navigate = useNavigate();
1414
return (
15-
<Center flexDir="column">
15+
<Box flexDir="column" w="568px">
1616
<Heading mb="48px" fontSize="4xl" fontWeight="semibold">
1717
Before We Start
1818
</Heading>
19-
<Text fontSize="16px" w="568px">
20-
We want you to know that we prioritize your privacy:
21-
</Text>
22-
<Card borderRadius="8px" my="12px" w="568px" p="20px">
19+
<Text fontSize="16px">We want you to know that we prioritize your privacy:</Text>
20+
<Card borderRadius="8px" my="12px" p="20px">
2321
<UnorderedList spacing="12px" ml="0">
2422
{texts.map((t) => (
2523
<ListItem display="flex" fontSize="md" key={t}>
@@ -29,20 +27,22 @@ export const BeforeStart: FC = () => {
2927
))}
3028
</UnorderedList>
3129
</Card>
32-
<Text w="568px" fontSize="16px" mb="72px">
30+
<Text fontSize="16px" mb="72px">
3331
We are not in the information collection business (even anonymous data).
3432
</Text>
3533

36-
<Button
37-
onClick={() => {
38-
navigate('/create/account');
39-
}}
40-
data-test-id="getStarted"
41-
size="lg"
42-
w="148px"
43-
>
44-
Get Started
45-
</Button>
46-
</Center>
34+
<Center>
35+
<Button
36+
onClick={() => {
37+
navigate('/create/account');
38+
}}
39+
data-test-id="getStarted"
40+
size="lg"
41+
w="148px"
42+
>
43+
Get Started
44+
</Button>
45+
</Center>
46+
</Box>
4747
);
4848
};

packages/extension-chrome/src/pages/WalletManager/containers/ConfirmMnemonic.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ export const ConfirmMnemonic: FC = () => {
6565
}, [isAllCorrect, setNextAvailable]);
6666

6767
return (
68-
<Center w="480px" flexDir="column">
68+
<Box w="480px" flexDir="column">
6969
<Heading mb="48px" lineHeight="111%" fontWeight="semibold">
7070
Confirm your Seed
7171
</Heading>
72-
<Box fontSize="md" w="480px" mb="8px">
72+
<Box fontSize="md" mb="8px">
7373
Please select words in correct order to form your seed.
7474
</Box>
7575

76-
<Textarea data-test-id="selectedSeed" as="div" p="16px" w="480px" h="200px">
76+
<Textarea data-test-id="selectedSeed" as="div" p="16px" h="200px">
7777
{wordElements}
7878
</Textarea>
7979

80-
<SimpleGrid spacing="12px" marginTop="32px" columns={4} w="480px">
80+
<SimpleGrid spacing="12px" marginTop="32px" columns={4}>
8181
{word4Choose.map((word, index) => {
8282
const chosenOrder = chosenIndex.findIndex((i) => i === index);
8383
const hasChosen = chosenOrder !== -1;
@@ -115,6 +115,6 @@ export const ConfirmMnemonic: FC = () => {
115115
);
116116
})}
117117
</SimpleGrid>
118-
</Center>
118+
</Box>
119119
);
120120
};

packages/extension-chrome/src/pages/WalletManager/containers/CreateProcessFrame.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { Logo } from '../../Components/Logo';
1212
import { ChevronLeftIcon, ChevronRightIcon } from '@chakra-ui/icons';
1313
import { CreateFlowConfig } from '../types';
14-
import { ProcessIndicator } from '../../Components/ProgressLine';
14+
import { ProgressIndicator } from '../../Components/ProgressIndicator';
1515
import { ProgressSteps } from '../../Components/ProgressSteps';
1616

1717
export type OutletContext = {
@@ -115,7 +115,7 @@ export const CreateProcessFrame: FC = () => {
115115
</Button>
116116
</HStack>
117117

118-
<ProcessIndicator total={flowPaths.length} current={currentPathIndex} />
118+
<ProgressIndicator total={flowPaths.length} current={currentPathIndex} />
119119
</Flex>
120120
</Flex>
121121
);

packages/extension-chrome/src/pages/WalletManager/containers/NewMnemonic.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
Flex,
1212
Text,
1313
useToast,
14-
Center,
1514
List,
1615
ListItem,
1716
ListIcon,
@@ -47,7 +46,7 @@ export const CreateMnemonic: FC = () => {
4746
}, [mnemonic, clipboard, setWalletStore]);
4847

4948
return (
50-
<Center flexDir="column" w="532px">
49+
<Box w="532px">
5150
<Heading mb="48px" lineHeight="111%" fontWeight="semibold">
5251
Generate Wallet Seed
5352
</Heading>
@@ -92,16 +91,6 @@ export const CreateMnemonic: FC = () => {
9291
</Box>
9392
</ListItem>
9493
</List>
95-
{/* <Flex>
96-
<ListMarker />
97-
<Text w="100%" fontSize="md" mt="-2px">
98-
Store this Seed in a password manager like 1Password.
99-
<br />
100-
<br />
101-
Please write this Seed on a piece of paper and store in a secure location. If you want even stronger security,
102-
write it down on multiple pieces of paper and store them in at least 2-3 different locations.
103-
</Text>
104-
</Flex> */}
105-
</Center>
94+
</Box>
10695
);
10796
};

0 commit comments

Comments
 (0)