1
1
import { useEffect , useRef , useState } from 'react'
2
2
import { useSearchParams } from 'react-router-dom'
3
- import { ViewVerticalIcon } from '@radix-ui/react-icons'
4
- import { useAtom , useSetAtom , useAtomValue } from 'jotai'
3
+ import { ArrowUpIcon , ViewVerticalIcon } from '@radix-ui/react-icons'
4
+ import { useAtom , useAtomValue , useSetAtom } from 'jotai'
5
5
import { useEffectOnce , useLocalStorage , useUpdateEffect } from 'react-use'
6
6
import { useCopyToClipboard } from 'usehooks-ts'
7
7
import { useTranslation } from 'react-i18next'
@@ -16,19 +16,18 @@ import { genPermalink } from '@/utils/helpers'
16
16
import {
17
17
SEARCH_PARAM_REGEX ,
18
18
SEARCH_PARAM_TESTS ,
19
+ STORAGE_GRAPH_TIP_VISIBLE ,
19
20
STORAGE_TEST_CASES ,
20
- STORAGE_GRAPH_TIP_VISIBLE
21
21
} from '@/constants'
22
22
import {
23
23
astAtom ,
24
24
clearSelectedAtom ,
25
+ selectedIdsAtom ,
25
26
updateFlagsAtom ,
26
- selectedIdsAtom
27
27
} from '@/atom'
28
28
import { useToast } from '@/components/ui/use-toast'
29
29
import { Toggle } from '@/components/ui/toggle'
30
30
import { ScrollArea , ScrollBar } from '@/components/ui/scroll-area'
31
- import { ArrowUpIcon } from "@radix-ui/react-icons"
32
31
33
32
function Home ( ) {
34
33
const [ searchParams , setSearchParams ] = useSearchParams ( )
@@ -116,7 +115,7 @@ function Home() {
116
115
} , [ ast ] )
117
116
118
117
useEffect ( ( ) => {
119
- if ( graphTipVisible && selectIds . length > 0 ) {
118
+ if ( graphTipVisible && selectIds . length > 0 ) {
120
119
setGraphTipVisible ( false )
121
120
}
122
121
} , [ selectIds , graphTipVisible , setGraphTipVisible ] )
@@ -136,18 +135,19 @@ function Home() {
136
135
>
137
136
< div className = { clsx ( 'flex-1 relative flex flex-col min-w-0 bg-graph-bg' , { 'justify-center' : ! graphShow } ) } >
138
137
{ graphShow && (
139
- < ScrollArea className = "flex-1 min-h-0 h-full relative" >
140
- { graphTipVisible &&
141
- < div className = "absolute bg-graph-bg bottom-0 left-1/2 -translate-x-1/2 z-10 text-sm inline-flex items-center py-1" >
142
- < ArrowUpIcon className = 'w-4 h-4 mr-2' />
143
- { t ( 'You can select nodes by dragging or clicking in the graph' ) }
144
- </ div >
145
- }
146
- < div className = "flex items-center justify-center p-8 h-full" >
147
- < Graph regex = { regex } ast = { ast } errorMsg = { errorMsg } />
138
+ < ScrollArea className = "flex-1 min-h-0 h-full relative" >
139
+ { graphTipVisible
140
+ && (
141
+ < div className = "absolute bg-graph-bg bottom-0 left-1/2 -translate-x-1/2 z-10 text-sm inline-flex items-center py-1" >
142
+ < ArrowUpIcon className = "w-4 h-4 mr-2" />
143
+ { t ( 'You can select nodes by dragging or clicking on the graph' ) }
148
144
</ div >
149
- < ScrollBar orientation = "horizontal" />
150
- </ ScrollArea >
145
+ ) }
146
+ < div className = "flex items-center justify-center p-8 h-full" >
147
+ < Graph regex = { regex } ast = { ast } errorMsg = { errorMsg } />
148
+ </ div >
149
+ < ScrollBar orientation = "horizontal" />
150
+ </ ScrollArea >
151
151
) }
152
152
< RegexInput
153
153
regex = { regex }
0 commit comments