From 3ce3bde231dc8674b7de7dfb6f4a0102fcc06773 Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Fri, 20 Sep 2019 18:08:27 +0400 Subject: [PATCH] Clear filter on sidebar close --- src/components/Sidebar/index.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Sidebar/index.jsx b/src/components/Sidebar/index.jsx index 2f90d538..30aeb636 100644 --- a/src/components/Sidebar/index.jsx +++ b/src/components/Sidebar/index.jsx @@ -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('') const classes = useSidebarStyles() + useEffect(() => { + setFilter('') + }, [isOpen]) + const searchClasses = { input: classes.searchInput, root: classes.searchRoot,