Skip to content
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

Add dYdX disclaimer & bump Skip Router version #64

Merged
merged 5 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@radix-ui/react-dialog": "^1.0.4",
"@radix-ui/react-toast": "^1.1.4",
"@radix-ui/react-tooltip": "^1.0.6",
"@skip-router/core": "^0.1.0-rc13",
"@skip-router/core": "^0.1.0-rc17",
"@tanstack/react-query": "^4.29.5",
"@types/node": "20.1.2",
"@types/react": "18.2.6",
Expand Down
11 changes: 8 additions & 3 deletions src/components/ChainSelect/ChainSelectContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ const ChainSelectContent: FC<Props> = ({ chains, onChange, onClose }) => {
) : (
<div className="h-full overflow-y-auto scrollbar-hide">
{filteredChains.map((chain) => {
let chainLogo = `${chainNameToChainlistURL(
chain.chainName,
)}/chainImg/_chainImg.svg`;
if (chain.chainID === "dydx-mainnet-1") {
chainLogo =
"https://raw.githubusercontent.com/cosmos/chain-registry/master/dydx/images/dydx.png";
}
return (
<button
className="flex text-left w-full items-center gap-4 hover:bg-[#ECD9D9] p-4 rounded-lg transition-colors"
Expand All @@ -107,9 +114,7 @@ const ChainSelectContent: FC<Props> = ({ chains, onChange, onClose }) => {
<img
alt={chain.prettyName}
className="w-12 h-12 rounded-full"
src={`${chainNameToChainlistURL(
chain.chainName,
)}/chainImg/_chainImg.svg`}
src={chainLogo}
onError={(e) =>
(e.currentTarget.src =
"https://api.dicebear.com/6.x/shapes/svg")
Expand Down
17 changes: 17 additions & 0 deletions src/components/SwapWidget/SwapWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,23 @@ export const SwapWidget: FC = () => {
<p className="flex-1">No route found</p>
</div>
)}
{destinationChain?.chainID === "dydx-mainnet-1" ? (
<div className="bg-red-50 text-red-500 font-medium uppercase text-xs p-3 rounded-md flex items-center w-full text-left">
<p className="flex-1">
This transaction will let you transfer and stake tokens on dydx,
it will not allow you to trade. Follow the{" "}
<a
href="https://dydx.exchange/"
className="underline"
target="_blank"
rel="noreferrer"
>
dydx frontend
Zygimantass marked this conversation as resolved.
Show resolved Hide resolved
</a>{" "}
directions to set up a trading account
</p>
</div>
) : null}
{sourceChain && !isWalletConnected && (
<button
className="bg-[#FF486E] text-white font-semibold py-4 rounded-md w-full transition-transform hover:scale-105 hover:rotate-1"
Expand Down
Loading