Skip to content

Commit bfe1171

Browse files
committed
feat: dark/light mode
1 parent dfaaf21 commit bfe1171

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

.changeset/dirty-seas-confess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chat-dbt": minor
3+
---
4+
5+
dark/light mode

ROADMAP.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Roadmap
22

3+
- bug in the autocomplete component
34
- Complete the readme file
45
- Implement the options into the web interface
56
- confirm
@@ -13,7 +14,7 @@
1314
- Vitests
1415
- Use the npm package as a library
1516
- Statistics e.g. time per request, tokens used, etc
16-
- Web interface in dark/light mode
17+
- Dark/light mode toggle
1718
- Add CI tests for both the CLI and the web interface
1819
- Nice to have (but complicated): when the context is preserved, allow queries from previous data e.g. "translate the previous result into french"
1920
- `--hide-sql`

pages/_app.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import { AppProps } from 'next/app'
22
import Head from 'next/head'
33
import { MantineProvider } from '@mantine/core'
44
import { AppWrapper } from '../utils/state'
5+
import { useColorScheme } from '@mantine/hooks'
56

67
export default function App(props: AppProps) {
78
const { Component, pageProps } = props
9+
const colorScheme = useColorScheme()
810

911
return (
1012
<>
@@ -19,10 +21,7 @@ export default function App(props: AppProps) {
1921
<MantineProvider
2022
withGlobalStyles
2123
withNormalizeCSS
22-
theme={{
23-
/** Put your mantine theme override here */
24-
colorScheme: 'light'
25-
}}
24+
theme={{ colorScheme }}
2625
>
2726
<AppWrapper>
2827
<Component {...pageProps} />

pages/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ const Page: React.FC = () => {
2727
theme.colors[color][theme.colorScheme === 'dark' ? 5 : 7]
2828

2929
const run = async () => {
30-
targetRef.current.dispatchEvent(
31-
new KeyboardEvent('keypress', {
30+
targetRef.current?.dispatchEvent(
31+
new KeyboardEvent('keydown', {
32+
bubbles: true,
33+
cancelable: true,
3234
key: 'Escape',
3335
keyCode: 27,
3436
which: 27

0 commit comments

Comments
 (0)