Clear filter on sidebar close
This commit is contained in:
parent
60e2bb0fcf
commit
3ce3bde231
|
@ -19,7 +19,7 @@ import useSidebarStyles from './style'
|
|||
import SafeList from './SafeList'
|
||||
import { WELCOME_ADDRESS } from '~/routes/routes'
|
||||
|
||||
const { useState } = React
|
||||
const { useState, useEffect } = React
|
||||
|
||||
type TSidebarContext = {
|
||||
isOpen: boolean,
|
||||
|
@ -51,6 +51,10 @@ const Sidebar = ({
|
|||
const [filter, setFilter] = useState<string>('')
|
||||
const classes = useSidebarStyles()
|
||||
|
||||
useEffect(() => {
|
||||
setFilter('')
|
||||
}, [isOpen])
|
||||
|
||||
const searchClasses = {
|
||||
input: classes.searchInput,
|
||||
root: classes.searchRoot,
|
||||
|
|
Loading…
Reference in New Issue