File tree 10 files changed +146
-460
lines changed
10 files changed +146
-460
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"_variables" : {
3
- "lastUpdateCheck" : 1738930819805
3
+ "lastUpdateCheck" : 1740585432909
4
4
}
5
5
}
Original file line number Diff line number Diff line change 34
34
"devDependencies" : {
35
35
"@astrojs/mdx" : " ^4.0.8" ,
36
36
"@astrojs/sitemap" : " 3.2.1" ,
37
- "astro" : " 5.2.5 " ,
37
+ "astro" : " 5.3.1 " ,
38
38
"astro-compress" : " ^2.3.6" ,
39
39
"eslint" : " ^8.18.0" ,
40
40
"hast-util-to-string" : " ^2.0.0" ,
47
47
},
48
48
"dependencies" : {
49
49
"@astrojs/preact" : " ^4.0.4" ,
50
- "@preact/signals" : " ^2.0.1" ,
51
- "invokers-polyfill" : " ^0.4.7" ,
52
- "preact" : " ^10.25.4"
50
+ "invokers-polyfill" : " ^0.5.2" ,
51
+ "preact" : " ^10.26.2"
53
52
}
54
53
}
Original file line number Diff line number Diff line change 1
- import { useSignal } from '@ preact/signals '
2
- import { useEffect , useRef } from 'preact/hooks '
1
+ import { useState } from 'preact/hooks '
2
+ import 'invokers-polyfill '
3
3
4
4
function NavigationContainer ( props ) {
5
- const isMenuOpen = useSignal ( false )
6
- const navRef = useRef ( null )
5
+ const [ isMenuOpen , setIsMenuOpen ] = useState ( false )
7
6
8
- useEffect ( ( ) => {
9
- function handleCommand ( e ) {
10
- if ( e . command === '--toggle-menu' ) {
11
- isMenuOpen . value = ! isMenuOpen . value
12
- e . source . setAttribute ( 'aria-expanded' , isMenuOpen . value )
13
- }
7
+ function handleCommand ( e ) {
8
+ if ( e . command === '--toggle-menu' ) {
9
+ setIsMenuOpen ( ! isMenuOpen )
10
+ e . source . setAttribute ( 'aria-expanded' , isMenuOpen )
14
11
}
15
-
16
- if ( navRef . current ) {
17
- navRef . current . addEventListener ( 'command' , handleCommand )
18
- }
19
-
20
- return ( ) => {
21
- if ( navRef . current ) {
22
- navRef . current . removeEventListener ( 'command' , handleCommand )
23
- }
24
- }
25
- } )
12
+ }
26
13
27
14
return (
28
- < nav ref = { navRef } id = "site-nav" className = { isMenuOpen . value ? 'opened' : '' } >
15
+ < nav onCommand = { handleCommand } id = "site-nav" className = { isMenuOpen ? 'opened' : '' } >
29
16
{ props . children }
30
17
</ nav >
31
18
)
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ const routesToNotPrefetch = ['/research/component-matrix']
58
58
}
59
59
</style >
60
60
61
- <NavigationContainer client:load >
61
+ <NavigationContainer client:only >
62
62
<CommunityLinks className =" mobile" />
63
63
64
64
<div class =" wrapper" >
Original file line number Diff line number Diff line change 1
1
import './toggle-menu-button.css'
2
- import 'invokers-polyfill'
3
2
4
3
function ToggleMenuButton ( ) {
5
4
return (
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { useEffect } from 'preact/hooks'
10
10
function Page ( ) {
11
11
useEffect ( ( ) => {
12
12
return history . replace ( '/get-involved' )
13
- } )
13
+ } , [ ] )
14
14
15
15
return null
16
16
}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useEffect } from 'preact/hooks'
3
3
function Page ( ) {
4
4
useEffect ( ( ) => {
5
5
return history . replace ( '/get-involved' )
6
- } )
6
+ } , [ ] )
7
7
8
8
return null
9
9
}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useEffect } from 'preact/hooks'
3
3
function Page ( ) {
4
4
useEffect ( ( ) => {
5
5
return history . replace ( '/get-involved' )
6
- } )
6
+ } , [ ] )
7
7
8
8
return null
9
9
}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useEffect } from 'preact/hooks'
3
3
function Page ( ) {
4
4
useEffect ( ( ) => {
5
5
return history . replace ( '/get-involved' )
6
- } )
6
+ } , [ ] )
7
7
8
8
return null
9
9
}
You can’t perform that action at this time.
0 commit comments