) => {
setQuery(e.target.value)
if (store.chats !== null && store.contacts !== null) {
const searchFilterFunction = (contact: ChatsArrType | ContactType) =>
contact.fullName.toLowerCase().includes(e.target.value.toLowerCase())
const filteredChatsArr = store.chats.filter(searchFilterFunction)
const filteredContactsArr = store.contacts.filter(searchFilterFunction)
setFilteredChat(filteredChatsArr)
setFilteredContacts(filteredContactsArr)
}
}
return (
theme.shape.borderRadius,
borderBottomLeftRadius: theme => theme.shape.borderRadius
},
'& > .MuiBackdrop-root': {
borderRadius: 1,
position: 'absolute',
zIndex: theme => theme.zIndex.drawer - 1
}
}}
>
`1px solid ${theme.palette.divider}`
}}
>
{store && store.userProfile ? (
`0 0 0 2px ${theme.palette.background.paper}`
}}
/>
}
>
) : null}
)
}}
/>
{!mdAbove ? (
) : null}
theme.spacing(5, 3, 3) }}>
Chats
{renderChats()}
Contacts
{renderContacts()}
)
}
export default SidebarLeft