diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-27 18:07:45 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:15:27 +0100 |
| commit | 05f1dfc6896d3affa7c494a1b955f230d836a4b7 (patch) | |
| tree | 3089d5c3145f241293b88b9a1bfe4bb85e8ca9e0 /tests/utils/index.tsx | |
| parent | 757201fdc5c04a3f15504f74bf8ab85bb6018c2b (diff) | |
feat: replace next-themes with a custom ThemeProvider
To be honest, next-themes was working fine. However since I use a theme
provider for Prism code blocks, some code is duplicated between this
app and the library. So I prefer to use a custom Provider without the
options I don't need.
Diffstat (limited to 'tests/utils/index.tsx')
| -rw-r--r-- | tests/utils/index.tsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/utils/index.tsx b/tests/utils/index.tsx index f86f6fa..2457285 100644 --- a/tests/utils/index.tsx +++ b/tests/utils/index.tsx @@ -2,10 +2,13 @@ import { render as rtlRender, type RenderOptions, } from '@testing-library/react'; -import { ThemeProvider } from 'next-themes'; import type { FC, ReactElement, ReactNode } from 'react'; import { IntlProvider } from 'react-intl'; -import { AckeeProvider, MotionProvider } from '../../src/utils/providers'; +import { + AckeeProvider, + MotionProvider, + ThemeProvider, +} from '../../src/utils/providers'; type ProvidersConfig = { children: ReactNode; @@ -24,7 +27,7 @@ type CustomRenderOptions = { */ const AllTheProviders: FC<ProvidersConfig> = ({ children, locale = 'en' }) => ( <IntlProvider locale={locale}> - <ThemeProvider> + <ThemeProvider attribute="theme" storageKey="theme"> <AckeeProvider domainId="any-id" server="https://example.test" |
