Skip to content

Commit

Permalink
Display the recent DS blocks view conditionally.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaron Hirsch committed Jun 21, 2024
1 parent 8493fb8 commit 0174473
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { faQrcode } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { FC, lazy, memo, useContext, useState } from "react";
import { NavLink } from "react-router-dom";
import { NavLink, useSearchParams } from "react-router-dom";
import Header from "./Header";
import Logo from "./Logo";
import Timestamp from "./components/Timestamp";
import ChainInfo from "./execution/ChainInfo";
import RecentBlocks from "./execution/block/RecentBlocks";
import RecentDSBlocks from "./execution/block/RecentDSBlocks";
import { useGenericSearch } from "./search/search";
import { blockURL, slotURL } from "./url";
import { useFinalizedSlotNumber, useSlotTimestamp } from "./useConsensus";
Expand All @@ -28,14 +29,24 @@ const Home: FC = () => {

usePageTitle("Home");

const [searchParams, setSearchParams] = useSearchParams();
const isDevMode = searchParams.get("dev") === "1";

return (
<>
<Header sourcifyPresent={false} />
<div className="mx-1 my-1">
<ChainInfo />
</div>
<div className="grid grid-cols-5 gap-x-1 mx-1">
<span className="col-span-5">
{isDevMode ? (
<span className="col-span-2">
<RecentDSBlocks />
</span>
) : (
<div />
)}
<span className={isDevMode ? "col-span-3" : "col-span-5"}>
<RecentBlocks />
</span>
</div>
Expand Down

0 comments on commit 0174473

Please sign in to comment.