File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/components/UI/navigation Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 11import { useContext } from 'react'
22import logo from './../../../images/fallback.png'
33import { ContextScreenWidth } from '../../../App'
4+ import { setItemInStorage } from '../../../helper/setItemInStorage'
45
56export const HomeIcon = ( ) => {
67 const contextScreenWidth = useContext ( ContextScreenWidth )
@@ -10,18 +11,24 @@ export const HomeIcon = () => {
1011 )
1112 }
1213
14+ const clearFilter = ( ) => {
15+ setItemInStorage ( 'filter' , '' )
16+ }
17+
1318 const handleKeyDown = ( e : React . KeyboardEvent < HTMLAnchorElement > ) => {
1419 if ( e . key === ' ' ) {
1520 const target = e . target as HTMLElement
1621 target . click ( )
1722 e . preventDefault ( )
23+ clearFilter ( )
1824 }
1925 }
2026
2127 return (
2228 < a
2329 href = "/twitch-app/"
2430 className = "flex flex-row px-2 rounded-md pseudo-zinc navigation"
31+ onClick = { clearFilter }
2532 onKeyDown = { handleKeyDown }
2633 title = "Homepage"
2734 data-testid = "navigation-homepage-anchor"
You can’t perform that action at this time.
0 commit comments