-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new destination chain dropdown #1602
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
return networksToShow | ||
} | ||
|
||
const groupedNetworks = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should always have at least one core chain but just in case we only show groups if they have at least one chain
…e into new-destination-chain-dropdown
@@ -573,6 +625,14 @@ export function TransferPanelMain({ | |||
|
|||
useUpdateUSDCTokenData() | |||
|
|||
type NetworkListboxProps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from NetworkListbox.tsx
which got removed.
<SearchPanel.MainPage className="flex h-full max-w-[500px] flex-col py-4"> | ||
<NetworksPanel | ||
chainIds={supportedChainIds} | ||
selectedChainId={selectedChainId} | ||
close={() => props.onClose(false)} | ||
onNetworkRowClick={props.onChange} | ||
/> | ||
</SearchPanel.MainPage> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onClick={onClick} | ||
> | ||
<span className="max-w-[220px] truncate text-sm leading-[1.1] md:max-w-[250px] md:text-xl"> | ||
From: {getNetworkName(selectedChainId)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type NetworkListboxProps = { | ||
disabled?: boolean | ||
label: string | ||
options: Chain[] | ||
value: Chain | ||
onChange: (value: Chain) => void | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be deleted because really we only need onChange
for both from
and to
now
from: Pick<NetworkListboxProps, 'onChange'> | ||
to: Omit<NetworkListboxProps, 'label'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would just do and delete the other props from to
in the return object and getDestinationChains
because they are called within NetworkSelectionContainer
already
from: Pick<NetworkListboxProps, 'onChange'> | |
to: Omit<NetworkListboxProps, 'label'> | |
from: { | |
onChange: (value: Chain) => void | |
} | |
to: { | |
onChange: (value: Chain) => void | |
} |
@@ -429,6 +480,7 @@ export function TransferPanelMain({ | |||
} | |||
}, [nativeCurrency, ethL1Balance, ethL2Balance, erc20L1Balances]) | |||
|
|||
const [isTestnetMode] = useIsTestnetMode() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you shouldn't need this
@@ -66,12 +69,53 @@ import { | |||
Balances, | |||
useSelectedTokenBalances | |||
} from '../../hooks/TransferPanel/useSelectedTokenBalances' | |||
import { useIsTestnetMode } from '../../hooks/useIsTestnetMode' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you shouldn't need this
No description provided.