refactor(Nav/Conversation): reorganize imports and fix import paths

This commit is contained in:
Danny Avila 2023-07-27 10:11:57 -04:00 committed by Danny Avila
parent 4898f7489b
commit dd8bc39001
10 changed files with 42 additions and 25 deletions

View file

@ -1,11 +1,18 @@
import Conversation from './Conversation';
import { TConversation } from '@librechat/data-provider';
export default function Conversations({ conversations, moveToTop }) {
export default function Conversations({
conversations,
moveToTop,
}: {
conversations: TConversation[];
moveToTop: () => void;
}) {
return (
<>
{conversations &&
conversations.length > 0 &&
conversations.map((convo) => {
conversations.map((convo: TConversation) => {
return (
<Conversation key={convo.conversationId} conversation={convo} retainView={moveToTop} />
);

View file

@ -0,0 +1,5 @@
export { default as Pages } from './Pages';
export { default as Conversation } from './Conversation';
export { default as DeleteButton } from './DeleteButton';
export { default as RenameButton } from './RenameButton';
export { default as Conversations } from './Conversations';

View file

@ -0,0 +1,2 @@
export { default as ExportConversation } from './ExportConversation';
export { default as ExportModel } from './ExportModel';

View file

@ -1,5 +1,5 @@
import { forwardRef } from 'react';
import LogOutIcon from '../svg/LogOutIcon';
import { LogOutIcon } from '../svg';
import { useAuthContext } from '~/hooks/AuthContext';
import { useRecoilValue } from 'recoil';
import store from '~/store';

View file

@ -1,16 +1,13 @@
import { NewChat, NavLinks } from './';
import { Panel, Spinner } from '~/components';
import { Conversations, Pages } from '../Conversations';
import { useCallback, useEffect, useRef, useState } from 'react';
import { useGetConversationsQuery, useSearchQuery } from '@librechat/data-provider';
import { useRecoilValue, useSetRecoilState } from 'recoil';
import Conversations from '../Conversations';
import NavLinks from './NavLinks';
import NewChat from './NewChat';
import Pages from '../Conversations/Pages';
import { Panel, Spinner } from '~/components';
import { cn } from '~/utils/';
import { useAuthContext, useDebounce } from '~/hooks';
import store from '~/store';
import { localize } from '~/localization/Translation';
import { cn } from '~/utils/';
import store from '~/store';
export default function Nav({ navVisible, setNavVisible }) {
const [isHovering, setIsHovering] = useState(false);

View file

@ -1,19 +1,14 @@
import { Menu, Transition } from '@headlessui/react';
import { Fragment, useState } from 'react';
import { useRecoilValue } from 'recoil';
import SearchBar from './SearchBar';
import Settings from './Settings';
import { Download } from 'lucide-react';
import NavLink from './NavLink';
import ExportModel from './ExportConversation/ExportModel';
import ClearConvos from './ClearConvos';
import Logout from './Logout';
import { useRecoilValue } from 'recoil';
import { Fragment, useState } from 'react';
import { Menu, Transition } from '@headlessui/react';
import { SearchBar, ClearConvos, Settings, NavLink, Logout, ExportModel } from './';
import { LinkIcon, DotsIcon, GearIcon, TrashIcon } from '~/components';
import { localize } from '~/localization/Translation';
import { useAuthContext } from '~/hooks/AuthContext';
import { cn } from '~/utils/';
import store from '~/store';
import { LinkIcon, DotsIcon, GearIcon, TrashIcon } from '~/components';
import { localize } from '~/localization/Translation';
export default function NavLinks({ clearSearch, isSearchEnabled }) {
const [showExports, setShowExports] = useState(false);

View file

@ -0,0 +1,11 @@
export * from './ExportConversation';
export * from './SettingsTabs/';
export { default as ClearConvos } from './ClearConvos';
export { default as Logout } from './Logout';
export { default as MobileNav } from './MobileNav';
export { default as Nav } from './Nav';
export { default as NavLink } from './NavLink';
export { default as NavLinks } from './NavLinks';
export { default as NewChat } from './NewChat';
export { default as SearchBar } from './SearchBar';
export { default as Settings } from './Settings';

View file

@ -5,6 +5,7 @@ export { default as Panel } from './Panel';
export { default as Spinner } from './Spinner';
export { default as Clipboard } from './Clipboard';
export { default as CheckMark } from './CheckMark';
export { default as LogOutIcon } from './LogOutIcon';
export { default as MessagesSquared } from './MessagesSquared';
export { default as StopGeneratingIcon } from './StopGeneratingIcon';
export { default as GoogleIcon } from './GoogleIcon';

View file

@ -7,12 +7,11 @@ import {
} from '@librechat/data-provider';
import MessageHandler from '../components/MessageHandler';
import MobileNav from '../components/Nav/MobileNav';
import Nav from '../components/Nav';
import { Nav, MobileNav } from '../components/Nav';
import { Outlet } from 'react-router-dom';
import store from '~/store';
import { useAuthContext } from '~/hooks/AuthContext';
import { useSetRecoilState } from 'recoil';
import store from '~/store';
export default function Root() {
const [navVisible, setNavVisible] = useState(() => {