Skip to content

Commit

Permalink
Fix color scheme and search issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Sep 18, 2023
1 parent 98699d4 commit 93b4a94
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function Search({ data }: { data: any[] }) {
<Spotlight
store={searchStore}
shortcut={['mod + K', 'mod + P', '/']}
actions={actions}
actions={actions || []}
tagsToIgnore={[]}
highlightQuery
clearQueryOnClose
Expand Down
8 changes: 6 additions & 2 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '@mantine/dropzone/styles.css';
import '@mantine/spotlight/styles.css';
import '@mantine/ds/styles.css';
import Head from 'next/head';
import { MantineProvider, DirectionProvider } from "@mantine/core";
import { MantineProvider, DirectionProvider, localStorageColorSchemeManager } from "@mantine/core";
import { HotKeysHandler } from '@/components/HotKeysHandler';
import { Search } from '@/components/Search';
import { GaScript } from '@/components/GaScript';
Expand Down Expand Up @@ -35,7 +35,11 @@ export default function App({ Component, pageProps }: any) {
<GaScript />

<DirectionProvider initialDirection="ltr" detectDirection={false}>
<MantineProvider theme={theme} defaultColorScheme="auto">
<MantineProvider
theme={theme}
defaultColorScheme="auto"
colorSchemeManager={localStorageColorSchemeManager({ key: 'mantine-ui-color-scheme' })}
>
<HotKeysHandler />
<Component {...pageProps} />
<Search data={pageProps.allComponents} />
Expand Down
2 changes: 1 addition & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function Document() {
return (
<Html lang="en">
<Head>
<ColorSchemeScript defaultColorScheme="auto" />
<ColorSchemeScript defaultColorScheme="auto" localStorageKey="mantine-ui-color-scheme" />
</Head>
<body>
<Main />
Expand Down

0 comments on commit 93b4a94

Please sign in to comment.