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 SafeList from './SafeList'
|
||||||
import { WELCOME_ADDRESS } from '~/routes/routes'
|
import { WELCOME_ADDRESS } from '~/routes/routes'
|
||||||
|
|
||||||
const { useState } = React
|
const { useState, useEffect } = React
|
||||||
|
|
||||||
type TSidebarContext = {
|
type TSidebarContext = {
|
||||||
isOpen: boolean,
|
isOpen: boolean,
|
||||||
|
@ -51,6 +51,10 @@ const Sidebar = ({
|
||||||
const [filter, setFilter] = useState<string>('')
|
const [filter, setFilter] = useState<string>('')
|
||||||
const classes = useSidebarStyles()
|
const classes = useSidebarStyles()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setFilter('')
|
||||||
|
}, [isOpen])
|
||||||
|
|
||||||
const searchClasses = {
|
const searchClasses = {
|
||||||
input: classes.searchInput,
|
input: classes.searchInput,
|
||||||
root: classes.searchRoot,
|
root: classes.searchRoot,
|
||||||
|
|
Loading…
Reference in New Issue