This repository was archived by the owner on Mar 4, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,6 @@ const GenerateBlocks = ({
62
62
markdownParsingOptions ?: MarkdownToJSX . Options
63
63
} ) => {
64
64
65
- // Anchor fixture
66
- useAnchor ( ) ;
67
-
68
65
return (
69
66
< >
70
67
{ blocks &&
@@ -83,18 +80,13 @@ const GenerateBlocks = ({
83
80
} ) }
84
81
</ >
85
82
)
86
- } ;
87
-
88
- export { GenerateBlocks , supportedTypes }
89
-
90
- const useAnchor = ( ) => {
91
-
92
83
}
93
84
85
+ export { GenerateBlocks , supportedTypes }
94
86
95
87
const Anchor = styled . a `
96
- position: relative;
97
- display: none;
98
- visibility: hidden;
88
+ position: relative;
89
+ display: none;
90
+ visibility: hidden;
99
91
height: 0;
100
- ` ;
92
+ `
Original file line number Diff line number Diff line change 1
- import { useEffect , useMemo , useState } from " react"
1
+ import { useEffect , useMemo , useState } from ' react'
2
2
3
3
export const useHashSelected = ( targetHash ?: string ) => {
4
4
const [ hash , setHash ] = useState < string > ( )
5
5
6
- const updateHash = ( ) => setHash ( getHash ( ) ) ;
6
+ const updateHash = ( ) => setHash ( getHash ( ) )
7
7
8
8
useEffect ( ( ) => {
9
9
updateHash ( )
@@ -17,9 +17,9 @@ export const useHashSelected = (targetHash?: string) => {
17
17
if ( ! targetHash ) {
18
18
return false
19
19
}
20
-
20
+
21
21
const firstPart = hash ?. split ( '__' ) [ 0 ]
22
- const result = "#" + targetHash === firstPart
22
+ const result = '#' + targetHash === firstPart
23
23
return result
24
24
} , [ hash , targetHash ] )
25
25
}
You can’t perform that action at this time.
0 commit comments