@@ -62,9 +62,8 @@ export function Section({
62
62
}
63
63
64
64
export function SectionCode ( ) {
65
- const { props, setFocus } = React . useContext (
66
- SectionContext
67
- )
65
+ const { props, setFocus } =
66
+ React . useContext ( SectionContext )
68
67
69
68
const onTabClick = ( filename : string ) => {
70
69
setFocus ( { fileName : filename , focus : null , id : "" } )
@@ -84,27 +83,30 @@ export function SectionLink({
84
83
file ?: string
85
84
children : React . ReactNode
86
85
} ) {
87
- const {
88
- setFocus,
89
- resetFocus,
90
- selectedId,
91
- } = React . useContext ( SectionContext )
86
+ const { setFocus, resetFocus, selectedId } =
87
+ React . useContext ( SectionContext )
92
88
93
89
const isSelected = selectedId === id
94
- const handleClick = isSelected
95
- ? resetFocus
96
- : ( ) => setFocus ( { fileName : file , focus, id } )
90
+ // const handleClick = isSelected
91
+ // ? resetFocus
92
+ // : () => setFocus({ fileName: file, focus, id })
97
93
98
94
return (
99
95
< span
100
96
style = { {
101
97
textDecoration : "underline" ,
102
98
textDecorationStyle : "dotted" ,
103
99
cursor : "pointer" ,
104
- backgroundColor : isSelected ? "yellow" : undefined ,
100
+ backgroundColor : isSelected
101
+ ? "#bae6fd66"
102
+ : undefined ,
105
103
} }
106
- onClick = { handleClick }
104
+ // onClick={handleClick}
107
105
children = { children }
106
+ onMouseOver = { ( ) =>
107
+ setFocus ( { fileName : file , focus, id } )
108
+ }
109
+ onMouseOut = { resetFocus }
108
110
/>
109
111
)
110
112
}
0 commit comments