feat: simple api call to enable search

This commit is contained in:
Daniel Avila 2023-03-21 19:31:57 -04:00
parent 1041146fcb
commit 97a6cd801b
6 changed files with 50 additions and 38 deletions

View file

@ -1,22 +1,18 @@
import React from 'react';
import NavLink from './NavLink';
import LogOutIcon from '../svg/LogOutIcon';
import SearchBar from './SearchBar';
import ClearConvos from './ClearConvos';
import DarkMode from './DarkMode';
import Logout from './Logout';
import { useSelector } from 'react-redux';
export default function NavLinks({ fetch, onSearchSuccess, clearSearch }) {
const { searchEnabled } = useSelector((state) => state.search);
return (
<>
{/* <SearchBar fetch={fetch} onSuccess={onSearchSuccess} clearSearch={clearSearch}/> */}
{ !!searchEnabled && <SearchBar fetch={fetch} onSuccess={onSearchSuccess} clearSearch={clearSearch}/>}
<ClearConvos />
<DarkMode />
<Logout />
{/* <NavLink
svg={LogOutIcon}
text="Log out"
/> */}
</>
);
}