Skip to content

Commit

Permalink
refactor: Update import paths for RootProvider and AuthProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
Sma1lboy committed Nov 2, 2024
1 parent 5af5de7 commit 13015f1
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 34 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
} from '@/components/ui/resizable';
import { cn } from '@/lib/utils';
import { usePathname } from 'next/navigation';
import { useChatList } from './hooks/useChatList';
import Sidebar from '@/components/sidebar';
import { useChatList } from '../hooks/useChatList';

export default function RootLayout({
export default function MainLayout({
children,
}: {
children: React.ReactNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useParams } from 'next/navigation';
import { Message } from '@/components/types';
import { useModels } from '@/app/hooks/useModels';
import ChatContent from '@/components/chat/chat';
import { useChatStream } from '../hooks/useChatStream';
import { useChatStream } from '../../hooks/useChatStream';
import { useQuery } from '@apollo/client';
import { GET_CHAT_HISTORY } from '@/graphql/request';
import { toast } from 'sonner';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Metadata, Viewport } from 'next';
import { Inter } from 'next/font/google';
import MainLayout from './MainLayout';

const inter = Inter({ subsets: ['latin'] });

Expand All @@ -20,9 +21,5 @@ export default function Layout({
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en" suppressHydrationWarning>
<body className={inter.className}>{children}</body>
</html>
);
return <MainLayout>{children}</MainLayout>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import { useRef, useState } from 'react';
import { Message } from '@/components/types';
import { useModels } from './hooks/useModels';
import { useModels } from '../hooks/useModels';
import ChatContent from '@/components/chat/chat';
import { useChatStream } from './hooks/useChatStream';
import { useChatStream } from '../hooks/useChatStream';

export default function Home() {
const [messages, setMessages] = useState<Message[]>([]);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata, Viewport } from 'next';
import { Inter } from 'next/font/google';
import './globals.css';
import { RootProvider } from './providers';
import { BaseProviders } from './providers/BaseProvider';

const inter = Inter({ subsets: ['latin'] });

Expand All @@ -25,7 +25,7 @@ export default function RootLayout({
return (
<html lang="en" suppressHydrationWarning>
<body className={inter.className}>
<RootProvider>{children}</RootProvider>
<BaseProviders>{children}</BaseProviders>
</body>
</html>
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/providers/BaseProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { ApolloProvider } from '@apollo/client';
import { ThemeProvider } from 'next-themes';
import { Toaster } from 'sonner';
import { AuthProvider } from '../AuthProvider';
import RootLayout from '../RootLayout';

interface ProvidersProps {
children: React.ReactNode;
}

// Base Provider for the app
export function BaseProviders({ children }: ProvidersProps) {
return (
<ApolloProvider client={client}>
Expand Down
21 changes: 0 additions & 21 deletions frontend/src/app/providers/index.tsx

This file was deleted.

0 comments on commit 13015f1

Please sign in to comment.