diff --git a/packages/react-app/src/components/AmountIn.js b/packages/react-app/src/components/AmountIn.js index 03f2109..aeca9d6 100644 --- a/packages/react-app/src/components/AmountIn.js +++ b/packages/react-app/src/components/AmountIn.js @@ -6,7 +6,16 @@ import styles from "../styles"; const AmountIn = () => { const [showList, setShowList] = useState(false); + const [activeCurrency, setActiveCurrency] = useState("Select"); + const ref = useRef() + + useOnClickOutside(ref, () => setShowList(false)) + useEffect(() => { + if (Object.keys(currencies).includes(currencyValue)) + setActiveCurrency(currencies[currencyValue]); + else setActiveCurrency("Select"); + }, [currencies, currencyValue]); return(
@@ -31,6 +40,24 @@ const AmountIn = () => { {showList && ( + + )}