diff --git a/pkg/btc-wallet/src/js/components/lib/feePicker.js b/pkg/btc-wallet/src/js/components/lib/feePicker.js index 00e91c198d..9c7c77a542 100644 --- a/pkg/btc-wallet/src/js/components/lib/feePicker.js +++ b/pkg/btc-wallet/src/js/components/lib/feePicker.js @@ -1,4 +1,4 @@ -import React, { useEffect, useState, useRef } from 'react'; +import React from 'react'; import { Box, Text, @@ -6,38 +6,15 @@ import { StatelessRadioButtonField as RadioButton, Label, } from '@tlon/indigo-react'; +import { feeLevels } from './send'; -const feeLevels = { - low: 'low', - mid: 'mid', - high: 'high', -}; - -const FeePicker = ({ feeChoices, feeSelect, feeDismiss }) => { - const [feeSelected, setFeeSelected] = useState(feeLevels.mid); - const [modalElement, setModalElement] = useState(); - const modalRef = useRef(); - - // const clickDismiss = (e) => { - // console.log(modalElement, e); - // // if (modalRef && !modalRef.contains(e.target)) { - // // feeDismiss(); - // // } - // }; - +const FeePicker = ({ feeChoices, feeValue, setFeeValue, feeDismiss }) => { const select = (which) => { - setFeeSelected(which); - feeSelect(which); + console.log(which); + setFeeValue(feeLevels[which]); feeDismiss(); }; - // useEffect(() => { - // document.addEventListener('click', (e) => clickDismiss(e)); - // setModalElement(modalRef.current); - // console.log(modalRef.current); - // return () => document.addEventListener('click', clickDismiss); - // }, []); - return ( { { - select('low'); + select(feeLevels.low); }} >