Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Color Mode for Charka UI #327

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions frontend/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
"use client";

import { ToastContainer } from "react-toastify";
import { ChakraProvider } from "@chakra-ui/react";
import { ChakraProvider, ColorModeScript } from "@chakra-ui/react";
import { QueryClient, QueryClientProvider } from "react-query";
import { Client } from "@langchain/langgraph-sdk";

import { ChatWindow } from "./components/ChatWindow";
import { LangGraphClientContext } from "./hooks/useLangGraphClient";
import { apiBaseUrl } from "./utils/constants";

import theme from './theme'

export default function Home() {
const queryClient = new QueryClient();
const langGraphClient = new Client({ apiUrl: apiBaseUrl });
return (
<LangGraphClientContext.Provider value={langGraphClient}>
<QueryClientProvider client={queryClient}>
<ChakraProvider>
<ColorModeScript initialColorMode={theme.config.initialColorMode} />
<ChakraProvider theme={theme}>
<ToastContainer />
<ChatWindow />
</ChakraProvider>
Expand Down
11 changes: 11 additions & 0 deletions frontend/app/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { extendTheme, type ThemeConfig } from '@chakra-ui/react'

const config: ThemeConfig = {
initialColorMode: 'system',
useSystemColorMode: false,
}

// 3. extend the theme
const theme = extendTheme({ config })

export default theme