mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-04-12 01:26:17 +00:00
Add option to hide WikiTree-specific menus
This commit is contained in:
13
src/app.tsx
13
src/app.tsx
@@ -105,6 +105,7 @@ interface Arguments {
|
|||||||
selection?: IndiInfo;
|
selection?: IndiInfo;
|
||||||
chartType: ChartType;
|
chartType: ChartType;
|
||||||
standalone: boolean;
|
standalone: boolean;
|
||||||
|
showWikiTreeMenus: boolean;
|
||||||
freezeAnimation: boolean;
|
freezeAnimation: boolean;
|
||||||
showSidePanel: boolean;
|
showSidePanel: boolean;
|
||||||
config: Config;
|
config: Config;
|
||||||
@@ -167,6 +168,7 @@ function getArguments(location: H.Location<any>): Arguments {
|
|||||||
|
|
||||||
showSidePanel: getParam('sidePanel') !== 'false', // True by default.
|
showSidePanel: getParam('sidePanel') !== 'false', // True by default.
|
||||||
standalone: getParam('standalone') !== 'false' && !embedded,
|
standalone: getParam('standalone') !== 'false' && !embedded,
|
||||||
|
showWikiTreeMenus: getParam('showWikiTreeMenus') !== 'false', // True by default.
|
||||||
freezeAnimation: getParam('freeze') === 'true', // False by default
|
freezeAnimation: getParam('freeze') === 'true', // False by default
|
||||||
config: argsToConfig(search),
|
config: argsToConfig(search),
|
||||||
};
|
};
|
||||||
@@ -185,6 +187,11 @@ export function App() {
|
|||||||
const [showSidePanel, setShowSidePanel] = useState(false);
|
const [showSidePanel, setShowSidePanel] = useState(false);
|
||||||
/** Whether the app is in standalone mode, i.e. showing 'open file' menus. */
|
/** Whether the app is in standalone mode, i.e. showing 'open file' menus. */
|
||||||
const [standalone, setStandalone] = useState(true);
|
const [standalone, setStandalone] = useState(true);
|
||||||
|
/**
|
||||||
|
* Whether the app should display WikiTree-specific menus when showing data
|
||||||
|
* from WikiTree.
|
||||||
|
*/
|
||||||
|
const [showWikiTreeMenus, setShowWikiTreeMenus] = useState(true);
|
||||||
/** Type of displayed chart. */
|
/** Type of displayed chart. */
|
||||||
const [chartType, setChartType] = useState<ChartType>(ChartType.Hourglass);
|
const [chartType, setChartType] = useState<ChartType>(ChartType.Hourglass);
|
||||||
/** Whether to show the error popup. */
|
/** Whether to show the error popup. */
|
||||||
@@ -310,6 +317,7 @@ export function App() {
|
|||||||
setSourceSpec(args.sourceSpec);
|
setSourceSpec(args.sourceSpec);
|
||||||
setSelection(args.selection);
|
setSelection(args.selection);
|
||||||
setStandalone(args.standalone);
|
setStandalone(args.standalone);
|
||||||
|
setShowWikiTreeMenus(args.showWikiTreeMenus);
|
||||||
setChartType(args.chartType);
|
setChartType(args.chartType);
|
||||||
setFreezeAnimation(args.freezeAnimation);
|
setFreezeAnimation(args.freezeAnimation);
|
||||||
setConfig(args.config);
|
setConfig(args.config);
|
||||||
@@ -524,7 +532,10 @@ export function App() {
|
|||||||
onDownloadPng,
|
onDownloadPng,
|
||||||
onDownloadSvg,
|
onDownloadSvg,
|
||||||
}}
|
}}
|
||||||
showWikiTreeMenus={sourceSpec?.source === DataSourceEnum.WIKITREE}
|
showWikiTreeMenus={
|
||||||
|
sourceSpec?.source === DataSourceEnum.WIKITREE &&
|
||||||
|
showWikiTreeMenus
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user