File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,14 @@ function Projects() {
172172 window . $ ( ".stack" ) . lettering ( ) ;
173173 } , [ ] )
174174
175+ useEffect ( ( ) => {
176+ if ( ! window . location . hash ) return
177+ let mayBeTag = decodeURI ( window . location . hash . slice ( 1 , window . location . hash . length ) ) . replace ( 'tag_' , "" )
178+ if ( tags . includes ( mayBeTag ) ) {
179+ setCurrentTag ( mayBeTag )
180+ }
181+ } , [ ] )
182+
175183 return (
176184 < Layout title = "Projects" >
177185 { /*
@@ -188,7 +196,10 @@ function Projects() {
188196 < button
189197 key = { tag }
190198 className = { clsx ( styles . tag , currentTag === tag && styles . tagActive ) }
191- onClick = { ( ) => setCurrentTag ( tag ) }
199+ onClick = { ( ) => {
200+ window . location . hash = 'tag_' + tag
201+ setCurrentTag ( tag )
202+ } }
192203 >
193204 { tag }
194205 </ button > )
You can’t perform that action at this time.
0 commit comments