Skip to content

Commit

Permalink
feat: added navigation handling for launchpad to editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin101Zhang committed Jul 26, 2024
1 parent 6cbae96 commit 01632b9
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions frontend/widgets/src/QueryApi.Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,20 @@ return (
Explore Indexers
</TabsButton>

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


Expand All @@ -114,35 +118,35 @@ return (
</Section>
)}

{activeTab === "create-new-indexer" && (
{activeTab === 'launch-new-indexer' && (
<Section>
<Widget
src={`${REPL_ACCOUNT_ID}/widget/QueryApi.Editor`}
props={{
indexerName: selectedIndexer ? selectedIndexer.split('/')[1] : '',
accountId: selectedIndexer ? selectedIndexer.split('/')[0] : '',
path: "create-new-indexer",
indexerWizardCode: indexerWizardCode,
schemaWizardCode: schemaWizardCode,
}}
/>
</Section>
)}

{activeTab === 'indexer' && (
{activeTab === "create-new-indexer" && (
<Section>
<Widget
src={`${REPL_ACCOUNT_ID}/widget/QueryApi.Editor`}
props={{
indexerName: selectedIndexer ? selectedIndexer.split('/')[1] : '',
accountId: selectedIndexer ? selectedIndexer.split('/')[0] : '',
path: "query-api-editor",
tab: props.tab,
activeView: activeIndexerTabView
path: "create-new-indexer",
}}
/>
</Section>
)}

{activeTab === 'launch-new-indexer' && (
{activeTab === 'indexer' && (
<Section>
<Widget
src={`${REPL_ACCOUNT_ID}/widget/QueryApi.Editor`}
Expand All @@ -151,14 +155,13 @@ return (
accountId: selectedIndexer ? selectedIndexer.split('/')[0] : '',
path: "query-api-editor",
tab: props.tab,
activeView: activeIndexerTabView,
indexerWizardCode: indexerWizardCode,
schemaWizardCode: schemaWizardCode,
activeView: activeIndexerTabView
}}
/>
</Section>
)}


{!['launchpad', 'explore', 'indexer', 'create-new-indexer', 'launch-new-indexer'].includes(activeTab) && (
<Widget
src={`${REPL_ACCOUNT_ID}/widget/QueryApi.NotFound`}
Expand Down

0 comments on commit 01632b9

Please sign in to comment.