Skip to content

Commit 4bcc5f9

Browse files
committed
Design feedback
1 parent d96a685 commit 4bcc5f9

File tree

2 files changed

+16
-51
lines changed

2 files changed

+16
-51
lines changed

renderer/components/SendAssetsForm/SharedConfirmSteps/FeeGridSelector/FeeGridSelector.tsx

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import {
55
Flex,
66
Grid,
77
HStack,
8-
IconButton,
98
Skeleton,
109
Text,
1110
VStack,
1211
} from "@chakra-ui/react";
1312
import Image from "next/image";
14-
import React, { useMemo, useState, KeyboardEvent } from "react";
13+
import React, { useMemo, useState } from "react";
1514
import { useFormContext, Controller, useWatch } from "react-hook-form";
1615
import { defineMessages, useIntl } from "react-intl";
1716

@@ -164,14 +163,6 @@ function FeeGridSelector({
164163
return formatOre(0);
165164
};
166165

167-
const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
168-
if (e.key === "Enter") {
169-
if (Number(customFee) > 0) {
170-
setShowGrid(false);
171-
}
172-
}
173-
};
174-
175166
if (!estimatedFeesData) {
176167
return <FeeGridSkeleton showGrid={showGrid} />;
177168
}
@@ -226,7 +217,6 @@ function FeeGridSelector({
226217
feeField.onChange(key);
227218
clearErrors("customFee");
228219
resetField("customFee");
229-
setShowGrid(false);
230220
}}
231221
/>
232222
))}
@@ -247,7 +237,6 @@ function FeeGridSelector({
247237
? customFeeField.value
248238
: ""
249239
}
250-
onKeyDown={handleKeyDown}
251240
onSubmit={() => {
252241
Number(customFeeField.value) > 0 && setShowGrid(false);
253242
}}
@@ -267,28 +256,20 @@ function FeeGridSelector({
267256
}}
268257
icon={
269258
customFeeField.value && (
270-
<IconButton
271-
variant="ghost"
272-
borderRadius="full"
273-
color="white"
259+
<Box
274260
h={6}
275261
w={6}
276262
minW={6}
277263
bg="#5BA54C"
278-
onClick={() => setShowGrid(false)}
279-
aria-label="Save memo"
280-
isDisabled={Number(customFeeField.value) <= 0}
281-
_disabled={{
282-
bg: COLORS.GREEN_DARK,
283-
opacity: 0.4,
284-
cursor: "not-allowed",
285-
_hover: { bg: COLORS.GREEN_DARK },
286-
}}
287-
_hover={{
288-
opacity: 0.8,
289-
}}
290-
icon={<CheckIcon w={3} />}
291-
/>
264+
borderRadius="full"
265+
display="flex"
266+
alignItems="center"
267+
justifyContent="center"
268+
opacity={Number(customFeeField.value) <= 0 ? 0.4 : 1}
269+
color="white"
270+
>
271+
<CheckIcon w={3} />
272+
</Box>
292273
)
293274
}
294275
/>

renderer/components/SendAssetsForm/SharedConfirmSteps/MemoInput/MemoInput.tsx

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CheckIcon, CloseIcon } from "@chakra-ui/icons";
1+
import { CloseIcon } from "@chakra-ui/icons";
22
import { Box, Button, HStack, Text, IconButton, Flex } from "@chakra-ui/react";
33
import Image from "next/image";
44
import { useState } from "react";
@@ -99,6 +99,10 @@ const MemoInput = () => {
9999
color="white"
100100
variant="ghost"
101101
size="sm"
102+
h={6}
103+
minW={6}
104+
w={6}
105+
fontSize={8}
102106
onClick={() => {
103107
field.onChange("");
104108
setShowMemoInput(false);
@@ -109,26 +113,6 @@ const MemoInput = () => {
109113
}}
110114
icon={<CloseIcon />}
111115
/>
112-
<IconButton
113-
aria-label="Save memo"
114-
variant="ghost"
115-
borderRadius="full"
116-
color="white"
117-
size="sm"
118-
bg="#5BA54C"
119-
_hover={{
120-
opacity: 0.8,
121-
}}
122-
onClick={() => setShowMemoInput(false)}
123-
isDisabled={!field.value}
124-
_disabled={{
125-
bg: COLORS.GREEN_DARK,
126-
opacity: 0.4,
127-
cursor: "not-allowed",
128-
_hover: { bg: COLORS.GREEN_DARK },
129-
}}
130-
icon={<CheckIcon />}
131-
/>
132116
</HStack>
133117
}
134118
/>

0 commit comments

Comments
 (0)