File tree Expand file tree Collapse file tree 10 files changed +146
-460
lines changed
Expand file tree Collapse file tree 10 files changed +146
-460
lines changed Original file line number Diff line number Diff line change 11{
22 "_variables" : {
3- "lastUpdateCheck" : 1738930819805
3+ "lastUpdateCheck" : 1740585432909
44 }
55}
Original file line number Diff line number Diff line change 3434 "devDependencies" : {
3535 "@astrojs/mdx" : " ^4.0.8" ,
3636 "@astrojs/sitemap" : " 3.2.1" ,
37- "astro" : " 5.2.5 " ,
37+ "astro" : " 5.3.1 " ,
3838 "astro-compress" : " ^2.3.6" ,
3939 "eslint" : " ^8.18.0" ,
4040 "hast-util-to-string" : " ^2.0.0" ,
4747 },
4848 "dependencies" : {
4949 "@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"
5352 }
5453}
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 '
33
44function NavigationContainer ( props ) {
5- const isMenuOpen = useSignal ( false )
6- const navRef = useRef ( null )
5+ const [ isMenuOpen , setIsMenuOpen ] = useState ( false )
76
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 )
1411 }
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+ }
2613
2714 return (
28- < nav ref = { navRef } id = "site-nav" className = { isMenuOpen . value ? 'opened' : '' } >
15+ < nav onCommand = { handleCommand } id = "site-nav" className = { isMenuOpen ? 'opened' : '' } >
2916 { props . children }
3017 </ nav >
3118 )
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ const routesToNotPrefetch = ['/research/component-matrix']
5858 }
5959</style >
6060
61- <NavigationContainer client:load >
61+ <NavigationContainer client:only >
6262 <CommunityLinks className =" mobile" />
6363
6464 <div class =" wrapper" >
Original file line number Diff line number Diff line change 11import './toggle-menu-button.css'
2- import 'invokers-polyfill'
32
43function ToggleMenuButton ( ) {
54 return (
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { useEffect } from 'preact/hooks'
1010function Page ( ) {
1111 useEffect ( ( ) => {
1212 return history . replace ( '/get-involved' )
13- } )
13+ } , [ ] )
1414
1515 return null
1616}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useEffect } from 'preact/hooks'
33function Page ( ) {
44 useEffect ( ( ) => {
55 return history . replace ( '/get-involved' )
6- } )
6+ } , [ ] )
77
88 return null
99}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useEffect } from 'preact/hooks'
33function Page ( ) {
44 useEffect ( ( ) => {
55 return history . replace ( '/get-involved' )
6- } )
6+ } , [ ] )
77
88 return null
99}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useEffect } from 'preact/hooks'
33function Page ( ) {
44 useEffect ( ( ) => {
55 return history . replace ( '/get-involved' )
6- } )
6+ } , [ ] )
77
88 return null
99}
You can’t perform that action at this time.
0 commit comments