From d17d3a64c471eadcaaa0e4489c40e328f2d52885 Mon Sep 17 00:00:00 2001 From: Eugene Formanenko Date: Thu, 30 May 2024 16:53:55 +0200 Subject: [PATCH] feat: enable mainnet menu --- src/AppRoutes.tsx | 14 +++-------- src/layouts/NetworkLayout/NetworkMenu.tsx | 30 +++-------------------- 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/src/AppRoutes.tsx b/src/AppRoutes.tsx index 02363e6..13e8014 100644 --- a/src/AppRoutes.tsx +++ b/src/AppRoutes.tsx @@ -2,9 +2,7 @@ import React from 'react'; import { Navigate, Route, Routes } from 'react-router-dom'; -import { demoFeaturesEnabled } from '@hooks/demoFeaturesEnabled.ts'; import { NetworkLayout } from '@layouts/NetworkLayout'; -import { NetworkName, useSubsquidNetwork } from '@network/useSubsquidNetwork.ts'; import { AssetsPage } from '@pages/AssetsPage/AssetsPage.tsx'; import { Vesting } from '@pages/AssetsPage/Vesting.tsx'; import { DashboardPage } from '@pages/DashboardPage/DashboardPage.tsx'; @@ -22,18 +20,14 @@ import { hideLoader } from './index.tsx'; export const AppRoutes = () => { hideLoader(0); - const { network } = useSubsquidNetwork(); - return ( } path="/"> } index /> - {demoFeaturesEnabled() || network === NetworkName.Testnet ? ( - - } index /> - } path="workers/:peerId" /> - - ) : null} + + } index /> + } path="workers/:peerId" /> + } index /> diff --git a/src/layouts/NetworkLayout/NetworkMenu.tsx b/src/layouts/NetworkLayout/NetworkMenu.tsx index f220170..2ebbb76 100644 --- a/src/layouts/NetworkLayout/NetworkMenu.tsx +++ b/src/layouts/NetworkLayout/NetworkMenu.tsx @@ -4,14 +4,12 @@ import { Box, Button, buttonClasses, styled } from '@mui/material'; import { Link, useLocation } from 'react-router-dom'; import { useIsWorkerOperator } from '@api/subsquid-network-squid'; -import { demoFeaturesEnabled } from '@hooks/demoFeaturesEnabled'; import { AccountIcon } from '@icons/AccountIcon'; import { ComputersIcon } from '@icons/ComputersIcon'; import { ContactsIcon } from '@icons/ContactsIcon'; import { DashboardIcon } from '@icons/DashboardIcon'; import { DocumentIcon } from '@icons/DocumentIcon'; import { OpenInNewIcon } from '@icons/OpenInNewIcon'; -import { NetworkName, useSubsquidNetwork } from '@network/useSubsquidNetwork'; import { useWorkersChatUrl } from '@network/useWorkersChat'; interface NetworkMenuProps { @@ -135,38 +133,18 @@ export const Item = forwardRef( ); export const NetworkMenu = ({ onItemClick }: NetworkMenuProps) => { - const { network } = useSubsquidNetwork(); const { isWorkerOperator } = useIsWorkerOperator(); const workersChatUrl = useWorkersChatUrl(); - const showMenu = demoFeaturesEnabled() || network === NetworkName.Testnet; - return ( <>
- {/**/} - {showMenu ? ( - - ) : null} + - {showMenu ? ( - <> - - - - - ) : null} + + +