summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-07-22 19:54:42 +0200
committerThomas F. K. Jorna <[email protected]>2021-07-22 19:54:42 +0200
commit06a5d8633c79f4cfa240fdeffcd5fac56586aab8 (patch)
tree13d14b85d793f6f3c90a5710235dccc2f46cb37a /pages
parentccab511d1d0e928440a759b29a94b547207eb4ce (diff)
parent90e6ea18850ee01af21b65a9cff4537d9018c606 (diff)
resolve index conflict
Diffstat (limited to 'pages')
-rw-r--r--pages/index.tsx25
1 files changed, 16 insertions, 9 deletions
diff --git a/pages/index.tsx b/pages/index.tsx
index 75f2db7..06c7dc2 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -182,6 +182,7 @@ export function GraphPage() {
}, [])
const [threeDim, setThreeDim] = useState(false)
+ const [showTweeks, setShowTweeks] = useState(true)
if (!graphData) {
return null
@@ -189,13 +190,18 @@ export function GraphPage() {
return (
<div>
- <Tweaks
- {...{
- physics,
- setPhysics,
- threeDim,
- }}
- />
+ {showTweeks && (
+ <Tweaks
+ {...{
+ physics,
+ setPhysics,
+ threeDim,
+ }}
+ onClose={() => {
+ setShowTweeks(false)
+ }}
+ />
+ )}
<Graph
nodeById={nodeByIdRef.current!}
linksByNodeId={linksByNodeIdRef.current!}
@@ -286,9 +292,10 @@ export interface TweakProps {
physics: typeof initialPhysics
setPhysics: any
threeDim: boolean
+ onClose: () => void
}
export const Tweaks = function (props: TweakProps) {
- const { physics, setPhysics, threeDim } = props
+ const { physics, setPhysics, threeDim, onClose } = props
return (
<Box
zIndex="overlay"
@@ -309,7 +316,7 @@ export const Tweaks = function (props: TweakProps) {
onClick={() => setPhysics(initialPhysics)}
/>
</Tooltip>
- <CloseButton />
+ <CloseButton onClick={onClose} />
</Box>
<Accordion allowMultiple defaultIndex={[0]} allowToggle>
<AccordionItem>