Clear filter on sidebar close

This commit is contained in:
Mikhail Mikheev 2019-09-20 18:08:27 +04:00
parent 60e2bb0fcf
commit 3ce3bde231
1 changed files with 5 additions and 1 deletions

View File

@ -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,