Skip to content

Commit

Permalink
fix: update logic check network
Browse files Browse the repository at this point in the history
  • Loading branch information
tungnguyendinh committed Jul 24, 2024
1 parent f1e360c commit d416027
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/commons/Layout/Sidebar/SidebarMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { footerMenus, menus } from "src/commons/menus";
import { isExternalLink } from "src/commons/utils/helper";
import { RootState } from "src/stores/types";
import { setSidebar } from "src/stores/user";
import { FF_GLOBAL_IS_CONWAY_ERA } from "src/commons/utils/constants";
import { FF_GLOBAL_IS_CONWAY_ERA, NETWORK, NETWORKS } from "src/commons/utils/constants";

import FooterMenu from "../FooterMenu";
import {
Expand Down Expand Up @@ -102,6 +102,7 @@ const SidebarMenu: React.FC<RouteComponentProps> = ({ history }) => {
(i) =>
!((i.key === "glossary.governance" || i.key === "glossary.networkMonitoring") && !FF_GLOBAL_IS_CONWAY_ERA)
)
.filter((i) => !(i.key === "glossary.networkMonitoring" && NETWORK !== NETWORKS.mainnet))
.map((item, index) => {
const { href, key, children, icon, tooltip } = item;
const title = t(key || "");
Expand Down
4 changes: 2 additions & 2 deletions src/pages/NetworkMonitoring/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect } from "react";

import NetworkMonitoringComponent from "src/components/NetworkMonitoring";
import { FF_GLOBAL_IS_CONWAY_ERA } from "src/commons/utils/constants";
import { NETWORK, NETWORKS } from "src/commons/utils/constants";

import { StyledContainer } from "./styles";
import NotFound from "../NotFound";
Expand All @@ -10,7 +10,7 @@ const NetworkMonitoring = () => {
useEffect(() => {
document.title = `Network Monitoring | Cardano Blockchain Explorer`;
}, []);
if (!FF_GLOBAL_IS_CONWAY_ERA) return <NotFound />;
if (NETWORK !== NETWORKS.mainnet) return <NotFound />;
return (
<StyledContainer>
<NetworkMonitoringComponent />
Expand Down

0 comments on commit d416027

Please sign in to comment.