mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-20 15:08:34 +03:00
Fix feepicker issues
This commit is contained in:
parent
b4eae08f88
commit
09bfb81c84
@ -1,4 +1,4 @@
|
|||||||
import React from 'react';
|
import React, { useEffect, useRef } from 'react';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Text,
|
Text,
|
||||||
@ -20,7 +20,21 @@ const FeePicker: React.FC<Props> = ({
|
|||||||
feeValue,
|
feeValue,
|
||||||
setFeeValue,
|
setFeeValue,
|
||||||
feeDismiss,
|
feeDismiss,
|
||||||
}) => (
|
}) => {
|
||||||
|
const modalRef = useRef(null);
|
||||||
|
const clickDismiss = (e: any) => {
|
||||||
|
if (modalRef && !modalRef.current.contains(e.target)) {
|
||||||
|
feeDismiss();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
document.addEventListener('click', clickDismiss);
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener('click', clickDismiss);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
<Box
|
<Box
|
||||||
position="absolute"
|
position="absolute"
|
||||||
p={4}
|
p={4}
|
||||||
@ -28,6 +42,7 @@ const FeePicker: React.FC<Props> = ({
|
|||||||
zIndex={10}
|
zIndex={10}
|
||||||
backgroundColor="white"
|
backgroundColor="white"
|
||||||
borderRadius={3}
|
borderRadius={3}
|
||||||
|
ref={modalRef}
|
||||||
>
|
>
|
||||||
<Text fontSize={1} color="black" fontWeight="bold" mb={4}>
|
<Text fontSize={1} color="black" fontWeight="bold" mb={4}>
|
||||||
Transaction Speed
|
Transaction Speed
|
||||||
@ -80,5 +95,6 @@ const FeePicker: React.FC<Props> = ({
|
|||||||
</Col>
|
</Col>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export default FeePicker;
|
export default FeePicker;
|
||||||
|
@ -397,14 +397,19 @@ const Send: React.FC<Props> = ({ stopSending, value, conversion }) => {
|
|||||||
width="24px"
|
width="24px"
|
||||||
border="none"
|
border="none"
|
||||||
backgroundColor="rgba(33, 157, 255)"
|
backgroundColor="rgba(33, 157, 255)"
|
||||||
|
onClick={() => {
|
||||||
|
setShowFeePicker((prev) => {
|
||||||
|
if (prev) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
icon="ChevronSouth"
|
icon="ChevronSouth"
|
||||||
width="12px"
|
width="12px"
|
||||||
color="white"
|
color="white"
|
||||||
onClick={() => {
|
|
||||||
if (!showFeePicker) setShowFeePicker(true);
|
|
||||||
}}
|
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
|
Loading…
Reference in New Issue
Block a user