Skip to content

Commit f930954

Browse files
authored
Add a flag to hide STAC browser (#855)
* Add a flag to hide STAC browser * lint * try passing the flag through config * Update docs/jupyter-lite.json
1 parent ce0f370 commit f930954

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

packages/base/src/panelview/leftpanel.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { IJupyterGISModel, SelectionType } from '@jupytergis/schema';
2+
import { PageConfig } from '@jupyterlab/coreutils';
23
import { IStateDB } from '@jupyterlab/statedb';
34
import { CommandRegistry } from '@lumino/commands';
45
import { MouseEvent as ReactMouseEvent } from 'react';
@@ -30,11 +31,14 @@ interface ILeftPanelProps {
3031
export const LeftPanel: React.FC<ILeftPanelProps> = (
3132
props: ILeftPanelProps,
3233
) => {
34+
const hideStacPanel = PageConfig.getOption('HIDE_STAC_PANEL') === 'true';
35+
3336
const tabInfo = [
3437
{ name: 'layers', title: 'Layers' },
35-
{ name: 'stac', title: 'Stac Browser' },
38+
...(hideStacPanel ? [] : [{ name: 'stac', title: 'Stac Browser' }]),
3639
{ name: 'filters', title: 'Filters' },
3740
];
41+
3842
const [curTab, setCurTab] = React.useState<string | undefined>(
3943
tabInfo[0].name,
4044
);
@@ -71,9 +75,13 @@ export const LeftPanel: React.FC<ILeftPanelProps> = (
7175
state={props.state}
7276
></LayersBodyComponent>
7377
</TabsContent>
74-
<TabsContent value="stac">
75-
<StacPanel model={props.model}></StacPanel>
76-
</TabsContent>
78+
79+
{!hideStacPanel && (
80+
<TabsContent value="stac">
81+
<StacPanel model={props.model}></StacPanel>
82+
</TabsContent>
83+
)}
84+
7785
<TabsContent value="filters" className="jgis-panel-tab-content">
7886
<FilterComponent model={props.model}></FilterComponent>,
7987
</TabsContent>

0 commit comments

Comments
 (0)