Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/jupyter-lite.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"jupyter-lite-schema-version": 0,
"jupyter-config-data": {}
"jupyter-config-data": {
"HIDE_STAC_PANEL": "true"
}
}
16 changes: 12 additions & 4 deletions packages/base/src/panelview/leftpanel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IJupyterGISModel, SelectionType } from '@jupytergis/schema';
import { PageConfig } from '@jupyterlab/coreutils';
import { IStateDB } from '@jupyterlab/statedb';
import { CommandRegistry } from '@lumino/commands';
import { MouseEvent as ReactMouseEvent } from 'react';
Expand Down Expand Up @@ -30,11 +31,14 @@ interface ILeftPanelProps {
export const LeftPanel: React.FC<ILeftPanelProps> = (
props: ILeftPanelProps,
) => {
const hideStacPanel = PageConfig.getOption('HIDE_STAC_PANEL') === 'true';

const tabInfo = [
{ name: 'layers', title: 'Layers' },
{ name: 'stac', title: 'Stac Browser' },
...(hideStacPanel ? [] : [{ name: 'stac', title: 'Stac Browser' }]),
{ name: 'filters', title: 'Filters' },
];

const [curTab, setCurTab] = React.useState<string | undefined>(
tabInfo[0].name,
);
Expand Down Expand Up @@ -71,9 +75,13 @@ export const LeftPanel: React.FC<ILeftPanelProps> = (
state={props.state}
></LayersBodyComponent>
</TabsContent>
<TabsContent value="stac">
<StacPanel model={props.model}></StacPanel>
</TabsContent>

{!hideStacPanel && (
<TabsContent value="stac">
<StacPanel model={props.model}></StacPanel>
</TabsContent>
)}

<TabsContent value="filters" className="jgis-panel-tab-content">
<FilterComponent model={props.model}></FilterComponent>,
</TabsContent>
Expand Down
Loading