mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-07 19:18:52 +01:00
feat: main styling/ui/ux final changes
This commit is contained in:
parent
67161c983f
commit
8f58c95452
17 changed files with 166 additions and 70 deletions
|
|
@ -1,12 +1,13 @@
|
|||
import React, { useState, useCallback } from 'react';
|
||||
import React, { useCallback } from 'react';
|
||||
import { debounce } from 'lodash';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { useSelector, useDispatch } from 'react-redux';
|
||||
import { Search } from 'lucide-react';
|
||||
import { setQuery } from '~/store/searchSlice';
|
||||
import { setInputValue, setQuery } from '~/store/searchSlice';
|
||||
|
||||
export default function SearchBar({ fetch, clearSearch }) {
|
||||
const dispatch = useDispatch();
|
||||
const [inputValue, setInputValue] = useState('');
|
||||
const { inputValue } = useSelector((state) => state.search);
|
||||
// const [inputValue, setInputValue] = useState('');
|
||||
|
||||
const debouncedChangeHandler = useCallback(
|
||||
debounce((q) => {
|
||||
|
|
@ -28,10 +29,9 @@ export default function SearchBar({ fetch, clearSearch }) {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
const changeHandler = (e) => {
|
||||
let q = e.target.value;
|
||||
setInputValue(q);
|
||||
dispatch(setInputValue(q));
|
||||
q = q.trim();
|
||||
|
||||
if (q === '') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue