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

Support Darwinia network #20

Merged
merged 1 commit into from
Oct 28, 2024
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
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>
)}
</>
);
}
Loading