From f5b2eb58cb288d10cf1a27554bcec507527a1dec Mon Sep 17 00:00:00 2001 From: Kevin Zhang <42101107+Kevin101Zhang@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:55:12 -0400 Subject: [PATCH] feat: added conditions to render Indexer tab (#928) --- frontend/widgets/src/QueryApi.Dashboard.jsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/widgets/src/QueryApi.Dashboard.jsx b/frontend/widgets/src/QueryApi.Dashboard.jsx index 5cf01250..28afcced 100644 --- a/frontend/widgets/src/QueryApi.Dashboard.jsx +++ b/frontend/widgets/src/QueryApi.Dashboard.jsx @@ -33,6 +33,11 @@ const TabsButton = styled.button` &:hover { background: #e0e0e0; } + + &:disabled { + color: #999; + cursor: not-allowed; + } `; const IS_DEV = `${REPL_EXTERNAL_APP_URL}` === "https://queryapi-frontend-vcqilefdcq-ew.a.run.app" || `${REPL_EXTERNAL_APP_URL}` === "http://localhost:3000"; @@ -72,13 +77,16 @@ return ( Explore Indexers - selectTab("indexer")} selected={activeTab === "indexer"} + disabled={!selectedIndexer} > - Indexer ({selectedIndexer}) - + {!selectedIndexer + ? (activeTab !== "create-new-indexer" ? "Select an Indexer" : "Indexer Creation") + : `Indexer (${selectedIndexer})`} + }