-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecates redux fromValue in favor of local input component behavior
- Loading branch information
1 parent
8251989
commit 9db21b1
Showing
10 changed files
with
129 additions
and
192 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
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
24 changes: 24 additions & 0 deletions
24
packages/synapse-interface/components/StateManagedBridge/FromChainSelector.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,24 @@ | ||
import { setFromChainId } from '@/slices/bridge/reducer' | ||
import { ChainSelector } from '@/components/ui/ChainSelector' | ||
import { CHAINS_BY_ID } from '@/constants/chains' | ||
import { useFromChainListArray } from './hooks/useFromChainListArray' | ||
import { useBridgeState } from '@/slices/bridge/hooks' | ||
import { useWalletState } from '@/slices/wallet/hooks' | ||
|
||
export const FromChainSelector = () => { | ||
const { fromChainId } = useBridgeState() | ||
const { isWalletPending } = useWalletState() | ||
|
||
return ( | ||
<ChainSelector | ||
dataTestId="bridge-origin-chain" | ||
selectedItem={CHAINS_BY_ID[fromChainId]} | ||
isOrigin={true} | ||
label="From" | ||
itemListFunction={useFromChainListArray} | ||
setFunction={setFromChainId} | ||
action="Bridge" | ||
disabled={isWalletPending} | ||
/> | ||
) | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/synapse-interface/components/StateManagedBridge/FromTokenSelector.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,23 @@ | ||
import { setFromToken } from '@/slices/bridge/reducer' | ||
import { TokenSelector } from '@/components/ui/TokenSelector' | ||
import { useBridgeState } from '@/slices/bridge/hooks' | ||
import { useFromTokenListArray } from './hooks/useFromTokenListArray' | ||
import { useWalletState } from '@/slices/wallet/hooks' | ||
|
||
export const FromTokenSelector = () => { | ||
const { fromToken } = useBridgeState() | ||
const { isWalletPending } = useWalletState() | ||
|
||
return ( | ||
<TokenSelector | ||
dataTestId="bridge-origin-token" | ||
selectedItem={fromToken} | ||
isOrigin={true} | ||
placeholder="Out" | ||
itemListFunction={useFromTokenListArray} | ||
setFunction={setFromToken} | ||
action="Bridge" | ||
disabled={isWalletPending} | ||
/> | ||
) | ||
} |
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
Oops, something went wrong.