-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add SellNativeWarningBanner non-pure
- Loading branch information
1 parent
9433837
commit a1ddca2
Showing
3 changed files
with
30 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
apps/cowswap-frontend/src/modules/trade/containers/SellNativeWarningBanner/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Field } from 'legacy/state/types' | ||
|
||
import { SellNativeWarningBanner as Pure } from 'common/pure/InlineBanner/banners' | ||
import useNativeCurrency from 'lib/hooks/useNativeCurrency' | ||
|
||
import { useNavigateOnCurrencySelection } from '../../hooks/useNavigateOnCurrencySelection' | ||
import { useWrappedToken } from '../../hooks/useWrappedToken' | ||
|
||
export function SellNativeWarningBanner() { | ||
const native = useNativeCurrency() | ||
const wrapped = useWrappedToken() | ||
const navigateOnCurrencySelection = useNavigateOnCurrencySelection() | ||
|
||
return ( | ||
<Pure | ||
nativeSymbol={native.symbol} | ||
wrappedNativeSymbol={wrapped.symbol} | ||
sellWrapped={() => navigateOnCurrencySelection(Field.INPUT, wrapped)} | ||
wrapNative={() => navigateOnCurrencySelection(Field.OUTPUT, wrapped)} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters