better handle clearing swap form
This commit is contained in:
parent
5e113692f4
commit
986c6ce57a
|
@ -101,12 +101,18 @@ const SwapForm = () => {
|
||||||
const setAmountInFormValue = useCallback((amountIn: string) => {
|
const setAmountInFormValue = useCallback((amountIn: string) => {
|
||||||
set((s) => {
|
set((s) => {
|
||||||
s.swap.amountIn = amountIn
|
s.swap.amountIn = amountIn
|
||||||
|
if (!parseFloat(amountIn)) {
|
||||||
|
s.swap.amountOut = ''
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const setAmountOutFormValue = useCallback((amountOut: string) => {
|
const setAmountOutFormValue = useCallback((amountOut: string) => {
|
||||||
set((s) => {
|
set((s) => {
|
||||||
s.swap.amountOut = amountOut
|
s.swap.amountOut = amountOut
|
||||||
|
if (!parseFloat(amountOut)) {
|
||||||
|
s.swap.amountIn = ''
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ function MyApp({ Component, pageProps }: AppProps) {
|
||||||
<ConnectionProvider endpoint={endpoint}>
|
<ConnectionProvider endpoint={endpoint}>
|
||||||
<WalletProvider wallets={wallets} onError={onError}>
|
<WalletProvider wallets={wallets} onError={onError}>
|
||||||
<EnhancedWalletProvider>
|
<EnhancedWalletProvider>
|
||||||
<ThemeProvider defaultTheme="Dark">
|
<ThemeProvider defaultTheme="Mango Classic">
|
||||||
<ViewportProvider>
|
<ViewportProvider>
|
||||||
<Layout>
|
<Layout>
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
|
|
Loading…
Reference in New Issue