Skip to content

Commit

Permalink
feat: added conditions to render Indexer tab (#928)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin101Zhang authored Jul 26, 2024
1 parent a640ced commit f5b2eb5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions frontend/widgets/src/QueryApi.Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -72,13 +77,16 @@ return (
Explore Indexers
</TabsButton>

<TabsButton
{<TabsButton
type="button"
onClick={() => selectTab("indexer")}
selected={activeTab === "indexer"}
disabled={!selectedIndexer}
>
Indexer ({selectedIndexer})
</TabsButton>
{!selectedIndexer
? (activeTab !== "create-new-indexer" ? "Select an Indexer" : "Indexer Creation")
: `Indexer (${selectedIndexer})`}
</TabsButton>}
</Tabs>


Expand Down

0 comments on commit f5b2eb5

Please sign in to comment.