mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 10:50:14 +01:00
feat: Add SearchBar component to Nav (#760)
* feat: Add SearchBar component to Nav This commit adds the SearchBar component to the navigation bar in order to enable search functionality. Now users can easily search for specific items within the navigation. * Refactor Nav and SearchBar components The commit refactors the Nav component by moving the SearchBar component within the Nav component. This change ensures that the SearchBar is rendered only when the isSearchEnabled condition is true. In addition, the commit also modifies the styling of the SearchBar component by adding rounded corners and border to enhance the visual appearance. * Update gitignore * C Refactor search bar styles This commit refactors the styles of the search bar component in the Nav component. The border color and hover background color have been modified to improve the visual appearance. * Fix margin * Rename Logout.jsx to Logout.tsx and update import statements accordingly. Replace the use of Recoil and store with useLocalize hook for localization. Update the usage of localize function by removing the lang parameter.
This commit is contained in:
parent
1f5a79f073
commit
173b8ce2da
6 changed files with 13 additions and 27 deletions
26
client/src/components/Nav/Logout.tsx
Normal file
26
client/src/components/Nav/Logout.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { forwardRef } from 'react';
|
||||
import { LogOutIcon } from '../svg';
|
||||
import { useAuthContext } from '~/hooks/AuthContext';
|
||||
import { useLocalize } from '~/hooks';
|
||||
|
||||
const Logout = forwardRef(() => {
|
||||
const { logout } = useAuthContext();
|
||||
const localize = useLocalize();
|
||||
|
||||
const handleLogout = () => {
|
||||
logout();
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
return (
|
||||
<button
|
||||
className="flex w-full cursor-pointer items-center gap-3 px-3 py-3 text-sm text-white transition-colors duration-200 hover:bg-gray-700"
|
||||
onClick={handleLogout}
|
||||
>
|
||||
<LogOutIcon />
|
||||
{localize('com_nav_log_out')}
|
||||
</button>
|
||||
);
|
||||
});
|
||||
|
||||
export default Logout;
|
||||
Loading…
Add table
Add a link
Reference in a new issue