Skip to content

Commit

Permalink
Support Darwinia network (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
snoopy1412 authored Oct 28, 2024
1 parent b39d3b9 commit 00b5c9e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const DesktopChainSwitcher = ({ activeChain, onChainChange, isMobile }: ChainSwi
<DropdownMenu
selectedKeys={[String(activeChain.id)]}
selectionMode="single"
disabledKeys={[String(ChainId.DARWINIA)]}
onSelectionChange={(keys) => {
onChainChange?.(Number(keys.currentKey) as ChainId);
}}
Expand Down
25 changes: 1 addition & 24 deletions src/layout/tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { useCallback, useMemo } from 'react';
import { Modal, ModalBody, ModalContent, Tab, Tabs } from '@nextui-org/react';
import { Tab, Tabs } from '@nextui-org/react';
import { useLocation, useNavigate } from '@tanstack/react-router';

import { defiTabs } from '@/config/tabs';
import useWalletStatus from '@/hooks/useWalletStatus';
import { ChainId } from '@/types/chains';

export default function DefiTabs({ children }: { children: React.ReactNode }) {
const { currentChainId } = useWalletStatus();
const { pathname } = useLocation();

const navigate = useNavigate();
Expand Down Expand Up @@ -55,26 +52,6 @@ export default function DefiTabs({ children }: { children: React.ReactNode }) {
))}
</Tabs>
<div className="mt-[1.25rem] w-full">{children}</div>
{currentChainId === ChainId.DARWINIA && (
<Modal backdrop="blur" isOpen hideCloseButton>
<ModalContent className="h-[calc(100vw-1.24rem)] max-h-[28rem] w-[calc(100vw-1.24rem)] p-0 md:h-[25rem] md:w-[25rem]">
{() => (
<>
<ModalBody className="flex h-full w-full flex-col items-center justify-center p-5">
<div className="flex h-full w-full flex-col items-center justify-center gap-5">
<img src="/images/common/fail-icon.svg" alt="fail-icon" className="size-20" />
<div className="flex flex-col items-center justify-center gap-[0.62rem]">
<p className="text-center text-[1.125rem] font-bold text-foreground">
This network is not supported yet.
</p>
</div>
</div>
</ModalBody>
</>
)}
</ModalContent>
</Modal>
)}
</>
);
}

0 comments on commit 00b5c9e

Please sign in to comment.