Update AmountIn.js

This commit is contained in:
Daniel
2022-11-05 13:23:33 +01:00
parent db65a242ba
commit 429646f883

View File

@@ -19,49 +19,48 @@ const AmountIn = () => {
return( return(
<div className={styles.amountContainer}> <div className={styles.amountContainer}>
<input <input
placeholder="0.0" placeholder="0.0"
type="number" type="number"
value={value} value={value}
disabled={isSwapping} disabled={isSwapping}
onChange={(e) => typeof onChange === "function" && onChange(e.target.value)} onChange={(e) => typeof onChange === "function" && onChange(e.target.value)}
className={styles.amountInput} className={styles.amountInput}
/>
<div className="relative" onClick={() => setShowList(!showList)}>
<button className={styles.currencyButton}>
{activeCurrency}
<img
src={chevronDown}
alt="cheveron-down"
className={`w-4 h-4 object-contain ml-2 ${
showList ? "rotate-180" : "rotate-0"
}`}
/> />
<div className="relative" onClick={() => setShowList(!showList)}> </button>
<button className={styles.currencyButton}>
{"FHT"}
<img
src={chevronDown}
alt="cheveron-down"
className={`w-4 h-4 object-contain ml-2 ${
showList ? "rotate-180" : "rotate-0"
}`}
/>
</button>
{showList && ( {showList && (
<ul ref={ref} className={styles.currencyList}> <ul ref={ref} className={styles.currencyList}>
{Object.entries(currencies).map(([token, tokenName], index) => ( {Object.entries(currencies).map(([token, tokenName], index) => (
<li <li
key={index} key={index}
className={`${styles.currencyListItem} ${ className={`${styles.currencyListItem} ${
activeCurrency === tokenName ? "bg-site-dim2" : "" activeCurrency === tokenName ? "bg-site-dim2" : ""
} cursor-pointer`} } cursor-pointer`}
onClick={() => { onClick={() => {
if (typeof onSelect === "function") onSelect(token); if (typeof onSelect === "function") onSelect(token);
setActiveCurrency(tokenName); setActiveCurrency(tokenName);
setShowList(false); setShowList(false);
}} }}
> >
{tokenName} {tokenName}
</li> </li>
))} ))}
</ul> </ul>
)} )}
</div>
</div> </div>
</div>
) )
} }